Re: Initializing STL vector in a header class
Carlos Moreno wrote:
red floyd wrote:
static int const g_one = 1;
[skipped]
OH!! I think I may have completely misunderstood the
previous post ...
So, g_one was supposed to be "g sub 1"??? If so, then
I agere!! (well, more or less -- I don't see why I
would call it g_one instead of g_1 ...)
Sorry for the confusion :-) My point was to just demonstrate OP the
mere fact that static const ints may be initialized in the class
definition. The naming for the example was somewhat careless, as far
as I can see now. The prefix 'g_' was used to indicate "global"
symbol, 's_' is also often used for that purpose.
[skipped]
I would completely oppose to defining those constants
two and four to simply avoid writing 2 and 4 in the
code (and I thought that was what the previous poster
was doing)
I argee completely that using aliases for such obvious constants can
really does harm and should be avoided.
Alex
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]