[LLVMdev] Iterator issue in BranchFolder::RemoveBlocksWithHash?

Mike Stump mrs at apple.com
Tue May 27 14:48:55 PDT 2008


On May 27, 2008, at 2:01 PM, Dale Johannesen wrote:
> On May 27, 2008, at 1:40 PM, Mike Stump wrote:
>>
>> From n2461:
>>
>>> 8 The insert members shall not affect the validity of iterators and
>>> references to the container, and the erase members shall invalidate
>>> only iterators and references to the erased elements.
>>
>> Pretty clear.
>
>
> In the current standard that language appears under "associative
> containers", but this is a vector.

Ah, and from vector:

23.2.5.4 vector modifiers [vector.modifiers]

iterator erase(const_iterator position);
iterator erase(const_iterator first, const_iterator last);
4 Effects: Invalidates iterators and references at or after the point  
of the erase.

:-)  Sorry, didn't realize this was vector and the page this was on  
was marked container requirements and I didn't realize I was reading  
just the associative container requirements.

> In any event, I'm not arguing that this ought to work, just that the
> (current) standard is badly worded.

I think it was a bug in the original language standard.  You can ask  
Howard, if you're curious.



More information about the llvm-dev mailing list