This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
Re: V3 PATCH: Static data members
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: V3 PATCH: Static data members
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Wed, 15 Nov 2000 18:24:09 -0800 (PST)
- cc: gdr at codesourcery dot com, gcc-patches at gcc dot gnu dot org, libstdc++ at sources dot redhat dot com
> 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