в основном у меня есть пары (штат, код штата), которые являются подмножествами страны
[США] -> [VT] -> 32
, поэтому я использую std::map<tstring<std::map<tstring, unsigned int>>
, но у меня проблемы с присвоением кода штата
for(std::map<tstring, std::map<tstring, unsigned int>>::const_iterator it = countrylist.begin(); it != countrylist.end(); ++it)
{
foundCountry = !it->first.compare(_T("USA")); //find USA
if(foundCountry) it->second[_T("MN")] = 5; //Assignment fails
}
error C2678: binary '[' : no operator found which takes a left-hand operand of type 'const std::map<_Kty,_Ty>'