Kerrek SB's answer would be the right answer in general:
const std::unordered_map<std::string, std::string> ManagerDataTrait<Person>::Fields{
{ "blah", "blah" }
// ...
};
(N.B. no template<>
because you're defining a member of a specialization, not a specialization)
But that isn't supported by Visual C++, so the other alternative is to initialize the map with a function call, and return a map with the desired contents from the function:
std::unordered_map<std::string, std::string>
getFields()
{
std::unordered_map<std::string, std::string> fields;
fields["blah"] = "blah";
// ...
return fields;
}
const std::unordered_map<std::string, std::string> ManagerDataTrait<Person>::Fields = getFields();
A lambda is just syntactic sugar for doing the same thing, and I'm not sure it's clearer to use a lambda because the syntax is a bit uglier.