bug in library standard 23.2.1.3/4
Steve LoBasso
slobasso@yahoo.com
Thu Feb 15 19:12:00 GMT 2007
The standard states in 23.2.1.3/4:
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 a previously copied value of end() will be invalidated, but it must be invalidated.
Also, if a change to the standard is made, it should also consider the invalidation requirements of end() in the context of a container with only a single element when that element is erased.
I have enclosed a code sample showing the problem. Also the debug deque container implementation doesn't handle this situation very gracefully.
-Steve
____________________________________________________________________________________
Bored stiff? Loosen up...
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front
-------------- next part --------------
A non-text attachment was scrubbed...
Name: invalidation_bug.cpp
Type: application/octet-stream
Size: 573 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20070215/2642ceaa/attachment.obj>
More information about the Libstdc++
mailing list