我有一张地图
std::map< int, std::map<string, double> > myMap;
std::map< int, std::map<string, double> >::iterator itr;
迭代它:
itr = myMap.find(nodeI);
if (itr == myMap.end())
{
exit(1) ;
}
导致错误:
错误:与“operator=”不匹配 âitr = ((const PushList*)this)->PushList::myMap.std::map<:_Key, _Tp, _Compare, _Alloc>::find [与 _Key = int, _Tp = std::map<:std::basic_string<:char, std::char_traits<:char>, std::allocator<:char>>, 双精度, std::less<:std::basic_string<:char, std::char_traits<:char>, std::allocator<:char> >>, std::allocator<:std::pair<:const std::basic_string<:char, std::char_traits<:char>, std::allocator<:char> >, double> > >, _Compare = std::less<:int>, _Alloc = std::allocator<:std::pair<:const int, std::map<:std::basic_string<:char, std::char_traits<:char>, std::allocator<:char>>, 双精度, std::less<:std::basic_string<:char, std::char_traits<:char>, std::allocator<:char> >>, std::allocator<:std::pair<:const std::basic_string<:char, std::char_traits<:char>, std::allocator<:char> >, double> > > >](((const int&)((const int*)((int*)nodeI))))â
如何迭代地图的地图?