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)
|