tags:

views:

1998

answers:

1

Using this member initialization...

StatsScreen::StatsScreen( GameState::State level )
    : m_Level( level ) {
  ...//
}

I get the following warning...

extended initializer lists only available with -std=c++0x or -std=gnu++0x

Any information regarding this warning?

Edit: Warning went away after I removed one of the member that was assigned to a value inside the constructor (couldn't be done through member initialization) and made it a local variable instead of a class member. Still want to know what that warnings means though.

+5  A: 

I think you are initializing the object with {...} instead of (...):

StatsScreen ss{...}; // only available in C++0x
StatsScreen ss(...); // OK in C++98

To compile your code as C++0x code, just add the following flag when compiling:

g++ test.cpp -std=c++0x
AraK
One of the member in the constructor was initialized that way (however, it wasn't in the member initialization list) and that was the one I removed, so that makes sense.
Anonymous