when i try to remove an element: i go to secondMap which contains in second field a pointer to the first map, now when i try to erase it it gives me problems:
multimap<SortKey,T> firstMap;
multimap<SearchKey,pair<const SortKey,T>*> secondMap;
template <class T,class SortKey, class SearchKey> T GarageDataBase<T,SortKey,SearchKey>::Remove(SearchKey toRemove)
{
multimap<SearchKey,pair<const SortKey,T>*>::iterator it;
it=secondMap.find(toRemove);
multimap<SortKey,T>::const_iterator itr;
itr=(it->second);//pointer to a pair in the first map
firstMap.erase(itr);
}
i get:
error C2664: 'std::_Tree_iterator<_Mytree> std::_Tree<_Traits>::erase(std::_Tree_const_iterator<_Mytree>)' : cannot convert parameter 1 from 'std::_Tree_const_iterator<_Mytree>' to 'std::_Tree_const_iterator<_Mytree>'
error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const std::pair<_Ty1,_Ty2>' (or there is no acceptable conversion)
any idea?