
From: Jason Hise <chaos@ezequal.com>
Michael Goldshteyn wrote:
What is:
namespace boost { const class {
???
It worked with VC, but I just checked it with comeau and it failed to compile. To fix it, I had to provide a name for the class and an explicit default constructor. Naming the class null works, because then the class name is hidden by the global variable name and thus other instances of type null cannot be declared. Updated code:
That may cause grief to those using the -Wshadow option of recent vintage GCC's.
namespace boost { const class null { [snip] } null; }
According to the grammar, Comeau is wrong: class-specifier: class-head { member-specification(opt) } class-head: class-key identifier(opt) base-clause(opt) class-key nested-name-specifier identifier base-clause(opt) class-key nested-name-specifier(opt) template-id base-clause(opt) class-key: class struct union Note that "identifier" is optional. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;