I working with C++11 and have a Class containing the following Struct:
struct Settings{
const std::string name;
const std::string* A;
const size_t a;
};
class X {
static const Settings s;
//More stuff
};
In the .cpp
file I want to define it like this
X::s = {"MyName", {"one","two","three"}, 3};
But this does not work. However it does work using an intermediate variable
const std::string inter[] = {"one","two","three"};
X::s = {"MyName", inter, 3};
Is there a way to do it without the intermediate variable?