Topic: deficiency in standard at 23.2.1.3/4 [deque end invalidation during erase]
Author: slobasso@yahoo.com (Steve LoBasso)
Date: Sat, 17 Feb 2007 08:51:59 GMT Raw View
The standard states at 23.2.1.3/4:
deque erase(...)
Effects: ... An erase at either end of the deque invalidates only the iterators and the references to the erased elements.
This does not state that iterators to end will be invalidated.
It needs to be amended in such a way as to account for end invalidation.
Something like:
Any time the last element is erased, iterators to end are invalidated.
This would handle situations like:
erase(begin(), end())
erase(end() - 1)
pop_back()
resize(n, ...) where n < size()
pop_front() with size() == 1
-Steve
____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]