V3 PATCH: Static data members
Benjamin Kosnik
bkoz@redhat.com
Wed Nov 15 18:24:00 GMT 2000
> The copmiler should treat in-class initialized static const data
> members just like enums, and code written that way is cleaner. If the
> compiler doesn't treat those two things identically, that is a
> quality-of-implementation issue. I would recommend that in V3 we do
> what we think makes the cleanest code; if the compiler generates
> inferior code file a bug against the compiler.
I agree that code written with in-class initialized static const data
members is cleaner. I'd like to continue using them.
I think these patches are fine, for what it's worth. Thanks Mark: static
linkage and g++ has always been a bit of a black art, so getting this
properly linked on multiple platforms will take a bit of hacking around.
As an aside, I've noticed a lot of difficulty with gdb and these beasts.
In particular, the "Cannot address memory at address 0x000" stuff. That's
particularly annoying for me, because then gdb freaks on when you try to
look inside c++ classes that use this idiom, which include but are not
limited to string, locale, and most of iostreams. Is there anyway that
g++ can give a warning about these constructs, so that I can make sure
that everything is indeed defined? That would be quite helpful.
-benjamin
More information about the Libstdc++
mailing list