I am trying to create a static const vector of const vectors of ints (there's gotta be a better way to do this) in Visual Studio 2012 and I can't figure out the proper syntax to initialize it with. I believe 2012 uses a version of C++ that doesn't allow initializers but I don't know how else to accomplish what I want.
I've tried the following in 2013, and it seems 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 }, // 1
std::vector<int> { 26322 }, // 2
...
}
However, when I try the same in 2012, it errors out:
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 appropriate data type out there I can use? I simply want my static class to have a constant vector of vectors of ints so I can quickly read, but not modify, values.