This is the mail archive of the gcc-help@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] |
| Other format: | [Raw text] | |
On comp.lang.c++, Victor Bazarov says my example program is well-formed standard C++ according to the ISO C++ standard.
"Since their address is never taken, the 'foo::A' and 'foo::B' are, in fact, compile-time constant expressions that do not require storage. The objects, therefore, don't need to be defined outside of the class definition. g++ 3.3.3 is probably too old. It's even too old and non- compliant in this particular case even with 1998 version of the C++ Standard. The standard was amended to allow const statics to be only defined in the class definition if their address is not taken _even_ if they are "used" outside the class. [I am too lazy, though, to look it up in the Standard...]" -- Victor Bazarov (comp.lang.c++)
-- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |