TMapIter

Dear rooters,

could you please explain me how to iterate on TMap object?
In C++ I used to use constructions like:
map<key,value> map;
map<key,value>::iterator it;

for(it=map.begin(); it!=map.end(); it++){
cout << it->first << endl; // for the key
cout << it->second << endl; // for the value
}

I Itried to use TMapIter but get something senseless because (most probably) I used it in a wrong way.

Thank you in advance,
Dmitry

I reply myself for those who perhaps do not know the answer :slight_smile:

TMap *map = new TMap();
 // filling the map
TMapIter iterator(map,kIterForward);
 while (TObject* obj = iterator()) {
   MyObj* r = (MyObj*)map->GetValue(obj);

}