基本上我有(狀態,狀態碼)對,它們是國家 [USA] - > [VT] - > 32std :: map <tstring <std :: map <tstring,unsigned int >>賦值失敗
所以我用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>'
你以前用過STL嗎? – user44511 2009-04-23 22:50:23