This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: V3 PATCH: Static data members


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]