Possible Duplicate:
Initializing a static std::map<int, int> in C++
I this kind of map:
{'V', 'O'}
{'v', 'о'}
{'H', 'В'}
{'h', 'в'}
{'W', 'Ш'}
{'w', 'ш'}
But in VS 2005, when I run for
const static std::map<char, wchar_t> mapDimLetters =
{
{'V', 'O'},
{'v', 'о'},
{'H', 'В'},
{'h', 'в'},
{'W', 'Ш'},
{'w', 'ш'},
}
test
error C2552: 'mapDimLetters' : non-aggregates cannot be initialized with initializer list
1> 'std::map<_Kty,_Ty>' : Types with a base are not aggregate
1> with
1> [
1> _Kty=char,
1> _Ty=wchar_t
1> ]
error C2078: too many initializers
How can I fix it? Or what is the best way to define map with constant known beforehand values in the most efficient way?