Assume we have this:
std::list<Typel ist1(10, 1), list2(20, 2);
std::list<Type> ::iterator iter = list1.end();
list1.swap(list 2);
What happens here, according to the standard?
1) 'iter' still points to list1::end().
2) 'iter' now points to list2::end().
3) Undefined behavior.
std::list<Typel ist1(10, 1), list2(20, 2);
std::list<Type> ::iterator iter = list1.end();
list1.swap(list 2);
What happens here, according to the standard?
1) 'iter' still points to list1::end().
2) 'iter' now points to list2::end().
3) Undefined behavior.
Comment