I have a struct called member. Within member I have a std::string array called months that I would like to initialize to default values. This is how I am doing it currently:
template <typenameT>
struct member
{
std::string months[12];
std::string name;
T hours_worked[12];
T dues[12];
member() : months{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"} {};
};
However, whenever I compile I get this warning message:
warning: extended initializer lists only available with -std=c++0x or -std=gnu++0x
How can I do the initialization properly and get rid of this error message?
Edit:
I should of made my question more clear. I need compile this program on a older compiler and the -std=c++0x flag option will not be available to me. How can I do this correctly without using the flag.
-std=c++0xcompilation flag.-std=c++0xis not available.