Original Post
Hi, my problems goes like this: I have a std :: map and reverse_iterator is moving through its elements. Everything compiles and works fine, till I want to erase element that is pointed by that reverse iterator - I got compile errors saying that there's no erase() function in std :: map which would take reverse_iterator. However, as you know :-) there is erase version for normal iterator. I feel that's not very fair (maybe it's a pitfall of design?), but since it's how STL was designed, I think that there's nothing I can do about it directly - I have to workaround it [razz]. So, my question is - what would be the best performance efficient way of fixing this issue? I thought about dereferencing element that reverse_iterator was facing , then using its value to find() normal iterator to that element and then - erasing element through new iterator. Any ideas?