jeremy barrett <[EMAIL PROTECTED]> writes: >> Finally, it is entirely pointless to provide initAx() and initBx(). >> If you want to initialize A::x and B::x to some values, just do >> so directly: > > Here's the point. A and B are very generic classes that are included > in a number of different libraries I've built. So the static > initializers set x to something suitably generic for use in standard > cases.
Note that you likely will have unexpected interactions if A::x is in more than one shared library, and is initialized to a different value in each. > In order keep data appropriately hidden (and save myself some > bookkeeping), I add this constructor function to various of the shared > libraries to initialize x to something meaningful (conceptual zero) > for the given application/environment. I still do not understand what the difficulty with simple assignment is. Could you provide a simple example demonstrating the need for this 'constructor function' ? Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email. _______________________________________________ help-gplusplus mailing list help-gplusplus@gnu.org http://lists.gnu.org/mailman/listinfo/help-gplusplus