I have this special array of strings in c++:
#include <map>
#include <string>
std::map<std::string, std::map<int, std::string>> oParam;
oParam["pA"][0] = "a";
oParam["pA"][1] = "b";
oParam["pA"][2] = "c";
oParam["pB"][0] = "x";
oParam["pB"][1] = "y";
oParam["pB"][2] = "z";
But I would like to initialize it with an initialization list, something like this:
std::map<std::string, std::map<int, std::string>> oParam{
{ "pA", { "a", "b", "c" } },
{ "pB", { "x", "y", "z" } },
};
But this is giving me an error. Am I missing some brackets?