I have a struct, that looks something like
struct MyStruct {
static const std::vector<CustomStruct> someConstValues;
};
const std::vector<CustomStruct> MyStruct::someConstValues = {
CustomStruct(0),
CustomStruct(1)
};
The definition of the static member takes place outside of the struct since otherwise i get error: in-class initialization of static data member 'const std::vector<CustomStruct> MyStruct::someConstValues' of non-literal type
.
But in the example above i get multiple definition of 'MyStruct::someConstValues'
...
first defined here
.
How i can i tell the compiler to accept my static const std::vector<CustomStruct>
?