F
fabrice.gautier
Hi,
I found some Visual C++ that looked like this:
enum colors { red, blue, green };
void f(void)
{
colors C;
C = colors::red /* Is this valid ?? */
}
Is the last assigment a valid C++ syntax? It looks as if defining an
enum also define a namespace of the same name.
This code doesnt compile with gcc. Is it some MS only extension or is
that defined in some revision of the C++ language spec ?
Thanks
-- Fox
I found some Visual C++ that looked like this:
enum colors { red, blue, green };
void f(void)
{
colors C;
C = colors::red /* Is this valid ?? */
}
Is the last assigment a valid C++ syntax? It looks as if defining an
enum also define a namespace of the same name.
This code doesnt compile with gcc. Is it some MS only extension or is
that defined in some revision of the C++ language spec ?
Thanks
-- Fox