[LC++]enum, #define, const, static const, or member const???
Vincent.Penquerch at artworks.co.uk
Fri Apr 5 20:50:06 UTC 2002
> > - You are told when you forget a value in a switch.
> I tested this with gcc. It didn't tell me --- and I
> even had "-Wall" selected!
Then you use anonymous enums, which are really named numbers,
not a new type. If you give this new enum list a name, it becomes
a type, and GCC then warns.
> Isn't "static int const" equivalent to "int const"? Ie doesn't
> the latter default to static?
The default is not static. It will be exported.
Making something private implies it is part of a class, so it is
not in the global namespace anyway.
static (at global scope) means that the particular identifier
won't be exported, so won't pollute the global namespace. Note
that the static keyword in other places does not mean that.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the tuxCPProgramming