those are the maps:
multimap<SortKey,T> firstMap;
multimap<SearchKey,pair<SortKey,T>*> secondMap;
template <class T,class SortKey, class SearchKey> bool GarageDataBase<T,SortKey,SearchKey>::Add(T data,SortKey key1, SearchKey key2)
{
multimap<SortKey,T>::iterator it;
it=(firstMap.insert(pair<SortKey,T>(key1,data)));
pair<SortKey,T> *mizi=&*it;
secondMap.insert(pair<SearchKey,pair<SortKey,T>*>(key2,mizi));
return true;
}
I am trying to insert a pair into the firstMap and get a pointer to this pair and insert it into the "second" field in the secondMap
so that i could go into my firstMap from the secondmap.
pair<SortKey,T> *mizi=&*it;
this doesn't compile saying :
error C2440: 'initializing' : cannot convert from 'std::pair<_Ty1,_Ty2> *' to 'std::pair<_Ty1,_Ty2> *'
any idea whats going on or maybe a better way to make it work?