I am trying to create a static const vector of constant vectors ints (there should be a better way to do this) in Visual Studio 2012, and I cannot figure out the correct syntax for initializing it. I believe that 2012 uses a C ++ version that initializers do not allow, but I donโt know how else to accomplish what I want.
I tried the following in 2013 and seem to compile ok:
.h:
static const std::vector<const std::vector<int>> PartLibrary;
.cpp
const std::vector<const std::vector<int>> Parts::PartLibrary { std::vector<int> { 29434 },
However, when I try the same in 2012, it leads to errors:
Error 1 error C2470: 'PartLibrary' : looks like a function definition, but there is no parameter list; skipping apparent body
How can I properly initialize this? Is there a more suitable data type that I can use? I just want my static class to have a constant vector of int vectors, so I can quickly read, but not change the values.
source share