TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: AARE TALI
from: ERIK JAKOBSEN
date: 1997-04-20 21:08:00
subject: Static? Say what?

Hello Aare!
Replying to a message of Aare Tali to Erik Jakobsen:
 AT>>> static void x::xx(void)
 AT>>> {
 AT>>> }
 >>   this is not a valid c++  declaration or definition.
 AT>    Of course, and that's what i dislike. 
  Nope... thats what you dont understand.  
 1: static must be declare inside the class declaration, 
 2: linkage is not an question for classes (they are types). 
   
 
 AT> I wanted to restrict access
 AT> to x::xx (being already private) to this module only.
  then use a simple c- function ... you are confusing members functions  of a 
type with simple functions doing  
 AT> For ordinary
 AT> functions that's OK (put 'static' there and entry point will be
 AT> hidden), but methods are special in that point for some reason
 AT> unknown to me.
   Then try to understand whats the difference between functions and members. 
      
 AT>    I'll explain it a bit more. Private methods are visible to anyone
 AT> as far as linker is concerned. Compiler effectively restricts access
 AT> to private methods at the source level. But linker doesn't have a
 AT> foggiest (OK, no idea at all what all this is about) and there is
 AT> still a way to access private methods from outside. If you have a bit
 AT> assembly knowledge and know how compiler mangles names, you can
 AT> access them. 
   you are way out of line... if you do that and change compiler, you calls 
are void. 
   I suspect you are a victime of very bad understanding of objectoriented 
analyse and   design.  What you are trying to do is undefined as far as c++ 
are conserned.
      
 AT> Of course, usually it's not needed. But i consider it
 AT> same as having root password hard-coded to 'root' with the lame
 AT> excuse that 'usually noone wants to be root unless absolutely
 AT> necessary'.
       
   
 0   Erik!
             |-
             |\
--- FleetStreet 1.18 NR
---------------
* Origin: DataVisor BBS - TeamOS2 (2:238/52.136)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.