NH> Can you think of any situations in which this method of access to the
NH> value of bar_val is the most preferred or the only way? Do you think
NH> this method of access of the value of bar_val is in keeping with the
NH> spirit of C++? I'm just curious?
NH> BTW, when is it ever really necessary (not just possible) to use
NH> double-colons outside of method headers?
We did that in my com-sci class about 3 weeks ago, it could be useful for
things like keeping track of the number of instances of a class. You
initialize the variable at the start of the program, then the constructor you
increment the count and in the destructor you decrement it. It could be used
for things like keeping track of open windows (if it's a window class), or
other similar applications where the number of instances is important to know
or control.
--- Maximus/2 3.00
---------------
* Origin: LutherNet Christian BBS (1:153/7036)
|