#Reverse Iterator getting invalid upon using erase() on multiset
12 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
you need to get the next iterator before you erase. You can post increment your ritr and then erase from the map (ritr.base())then reassign again. Or you can get the next valid itr with the erase function. However ritr.base() is not pointing to 4 though...
If I dereference ritr.base(), it is printing 4 when *ritr is 3.
