DM> class c
DM> {
DM> public: // for simplicity
DM> static void foo();
DM> void bar();
DM> private:
DM> static int foo_val;
DM> int bar_val;
DM> };
DM> c::bar_val : from anywhere in namespace c with a valid object of
DM> type c. This includes foo() _IFF_ foo() has a valid c object. It
DM> can then have c_obj.bar_val directly, it has "access" to the
DM> private members since it is itself a member of the class.
Can you think of any situations in which this method of access to the
value of bar_val is the most preferred or the only way? Do you think
this method of access of the value of bar_val is in keeping with the
spirit of C++? I'm just curious?
BTW, when is it ever really necessary (not just possible) to use
double-colons outside of method headers?
* KWQ/2 1.2i *
--- TMail v1.31.5
---------------
* Origin: Diablo Valley PCUG-BBS, Walnut Creek, CA 510/943-6238 (1:161/55)
|