I have a multiset and a number of iterators pointing to its elements. What happens if the underlying element is deleted?
#include <set>
#include <iostream>
using namespace std;
int main(){
multiset<int> set;
for(int i = 0; i < 10; i++){
set.insert(i);
}
auto a = set.find(5);
auto b = set.find(5);
a = set.erase(a);
cout << *b << endl;
cout << *a << endl;
}
Is cout << *b << endl;
even defined afterwards?