lundi 30 mars 2015

How to solve the array initialization issue with visual studio 2013

I want to declare an array as one of the members of the Struct. It fails, the compiler throws the following error:



error C2536: ... : cannot specify explicit initializer for arrays


Here is my struct in .h file:



struct CommandRepo
{
std::string root_command[5] = { "create", "edit", "remove", "list", "setting" };
std::string Base = "^(create|edit|remove|settings|list)(?: *)(?:--([a-zA-Z]*))";
std::string EachWord = "(\\w+)";
};


It seems (as read somewhere in SO), VSC2013 is not fully compliant with C++11, and the error is associated with that lack of compliance. Is that true? How should I solve it?


Aucun commentaire:

Enregistrer un commentaire