This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Static members in templates in egcs-1.0.1
dave> I've been trying to find out for a while: does the C++ spec
dave> allow you to define static consts in the class definition?
dave> Egcs & g++ do, but all the compilers I've tried on NT
dave> complain. Here's what I'd like to do:
[ class.static.data ]
4 If a static data member is of const integral or const enumeration
type, its declaration in the class definition can specify a constant-
initializer which shall be an integral constant expression
(_expr.const_). In that case, the member can appear in integral con-
stant expressions within its scope. The member shall still be defined
in a namespace scope if it is used in the program and the namespace
scope definition shall not contain an initializer.
--
Mark Mitchell mmitchell@usa.net
Stanford University http://www.stanford.edu