Home Dashboard Directory Help
Search

Bug in std::deque. Non-conforming invalidation of iterators after pop_front() by davidjward30


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 533131
Opened: 2/12/2010 12:18:40 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Hello,

We observed that pop_front() on a deque can invalidate iterators to elements that are not deleted.

MS Documentation says:
"If an element is erased at the front of the deque, only that iterator and references to the erased element become invalid. "

This is consistent with the C++ 98 standard:

23.2.1.3:

4 Effects: An erase in the middle of the deque invalidates all the iterators and references to elements of the
deque. An erase at either end of the deque invalidates only the iterators and the references to the erased
elements.

Included code under steps to reproduce. Also applies to VS2005.



Details
Sign in to post a comment.
Posted by Microsoft on 7/27/2010 at 2:38 PM
Hi,

Thanks again for reporting this bug. We've fixed it, and the fix will be available in VC11.

As always, if you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by Microsoft on 2/16/2010 at 2:58 PM
Hi,

Thanks for reporting this bug. We've confirmed that your code triggers a spurious debug assertion. Unfortunately, it's too late to fix this in VC10, but we're keeping this bug open so that it can be fixed in VC11.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by Microsoft on 2/14/2010 at 6:52 PM
Thank you for reporting the issue.
We were able to reproduce the issue you are seeing. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 2/12/2010 at 7:04 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Posted by davidjward30 on 2/12/2010 at 3:44 AM
Bug also present in VS2010 RC
Sign in to post a workaround.