GCC compiler warning: extended initializer lists are only available with C ++ 0x

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 on this warning?

Edit: the warning was deleted after I deleted one of the members that was assigned a value inside the constructor (failed to execute through member initialization) and made it a local variable instead of a class member. Still want to know what that means, however.

+3
source share
1 answer

I think you initialize the object with {...}instead (...):

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

++ 0x, :

g++ test.cpp -std=c++0x
+12

Source: https://habr.com/ru/post/1725005/


All Articles