[LLVMdev] Iterator issue in BranchFolder::RemoveBlocksWithHash?

Dale Johannesen dalej at apple.com
Tue May 27 14:01:52 PDT 2008


On May 27, 2008, at 1:40 PM, Mike Stump wrote:

> On May 23, 2008, at 10:19 AM, Dale Johannesen wrote:
>> On May 23, 2008, at 4:10 AM, Nicolas Capens wrote:

>> I also am not a STL guru; the standard says erase
>> "Invalidates all the iterators and references after the point of the
>> erase"
>> which is not wonderfully worded, but I take it to mean an iterator
>> referring to the point of the erase remains valid....
>
> 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.  Has it been moved?
The language I quoted applies specifically to vectors.

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

> If you play with --i, be careful of iterators that point to the
> beginning.

Thanks, I've already hit that one.




More information about the llvm-dev mailing list