S
Single Stage to Orbit
I have this:
$ more static-initialisers.cpp
class Simple
{
static int mCounter = 0;
};
$ g++-4.6.3 -std=c++0x -c static-initialisers.cpp
static-initialisers.cpp:3:24: error: ISO C++ forbids in-class
initialization of non-const static member ‘mCounter’
Which version of G++ allows this? The docs for 4.7.x doesn't say if it
is allowed.
I know I can simply do:
int Simple::mCounter = 0
to get around this though.
$ more static-initialisers.cpp
class Simple
{
static int mCounter = 0;
};
$ g++-4.6.3 -std=c++0x -c static-initialisers.cpp
static-initialisers.cpp:3:24: error: ISO C++ forbids in-class
initialization of non-const static member ‘mCounter’
Which version of G++ allows this? The docs for 4.7.x doesn't say if it
is allowed.
I know I can simply do:
int Simple::mCounter = 0
to get around this though.