I have a template class with a private map member
template <typename T>
class MyClass
{
public:
MyClass(){}
private:
std::map<T,T> myMap;
}
I would like to create a private method that accepts an iterator to the map
void MyFunction(std::map<T,T>::iterator &myIter){....}
However, this gets a compile error: identifier 'iterator'. I don't need to pass an abstract iterator since MyFunction knows that it is a map iterator (and will only be used as a interator for myMap) and will treat it as such (accessing and modifying myIter->second). Passing myIter->second to MyFunction is not enough since MyFunction will also need to be able to ++myIter;.