V3 PATCH: Static data members

Gabriel Dos Reis gdr@codesourcery.com
Wed Nov 15 17:26:00 GMT 2000


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


More information about the Gcc-patches mailing list