I have a `static const` vector of strings. I want to initialize it in C++11.
My code:
// Settings.h
class Settings
{
public:
static const std::vector<std::wstring> TITLES;
}
//Settings.cpp
const std::vector<std::wstring> Settings::TITLES = {L"Disk", L"System", L"Appearance"};
?
?
I'm getting this error:
error C2552: 'TITLES' : non-aggregates cannot be initialized with initializer list
Intellisense in Visual Studio 2012 reports the error as:
Error: initialization with '{...}' is not allowed for object of type "const std::vector<std::wstring, std::allocator<std::wstring>>"
How do I initialize it correctly?