I googled a lot about erasing an element based on some condition while iterating from reverse. std::reverse_iterator
is good way to re-iterate but it doesn't offer a clean fool proof method to delete an element from what I found by reading.
Any good approach perhaps by using std::reverse_iterator
?
Asked
Active
Viewed 71 times
0

Shreevardhan
- 12,233
- 3
- 36
- 50

bdubey
- 307
- 4
- 13
-
http://stackoverflow.com/questions/1830158/how-to-call-erase-with-a-reverse-iterator – Piotr Siupa Jul 15 '15 at 14:21
-
possible duplicate of [reverse iterator] (http://stackoverflow.com/questions/1830158/how-to-call-erase-with-a-reverse-iterator) – Satish Chalasani Jul 15 '15 at 14:23
-
@Amit You can safely iterate through a container and erase elements out of it along the way. http://coliru.stacked-crooked.com/a/c8d351d22338c5f5 – NathanOliver Jul 15 '15 at 14:27