This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: V3 PATCH: Static data members
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: V3 PATCH: Static data members
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- Date: 16 Nov 2000 02:26:27 +0100
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at sources dot redhat dot com
- Organization: CodeSourcery, LLC
- References: <20001115170202U.mitchell@codesourcery.com>
Mark Mitchell <mark@codesourcery.com> writes:
| G++ doesn't handle static data members well (they are not implicitly
| instantiated) on AIX, and it may not do so in the near future. It
| handles *const* static data members better, because it often doesn't
| actually allocate storage for the constants.
Is that a conforming behaviour? static data members have external
linkage and I would expect the compiler to allocate storage for such
beasts.
You've hit a reason why I recommand using enums where possible in lieu
of static integral data members. See a recent patch of mine about
_Count_ones<>.
| That means that we should try to avoid non-const static data members
| in V3, when possible.
Agreed. As a related note I encourage people interested in V3
developement to take a look at bits/cpp_tyoe_traits.h. Comments are
welcome.
-- Gaby