KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is it possible to peek next element in a container which the iterator currently points to without changing the iterator? For example in std::set, int myArray[]= {1,2,3,4}; set <int> mySet(myArray, myArray+4); set <int>::iterator iter = mySet.begin(); //peek the next element in set without changing iterator. mySet.erase(iter); //erase the element if next element is n+1
Tags (comma-separated)
Save Edits
Cancel