I have map. I need to iterate it not from the beginning, but from the desired key.
I tried it as;
int candidate_s;
map<int, vector<int> >::iterator map;
for(map = a_list.begin()+candidate_s; map! = a_list.end(); map++){
cout<<map->first<<"= ";
for(vector<int>::iterator vec=map->second.begin(); vec!=map->second.end(); vec++){
cout<<*vec<<" ";
}
cout<<endl;
}
and I got the following error message:
D:\c_mess\merging\src\main.cpp no match for 'operator+' in '(+a_list)->std::map<_Key, _Tp, _Compare, _Alloc>::begin [with _Key = int, _Tp = std::vector<int, std::allocator<int> >, _Compare = std::less<int>, _Alloc = std::allocator<std::pair<const int, std::vector<int, std::allocator<int> > > >]() + candidate_s'
Please help me to rectify this.
On the assumption that
candidate_sis of the type of thestd::map‘s key: