Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] adjacency_iterator invalidation with adjacency_list<listS, listS, unorderedS>
From: cobalto (scott.a.merritt_at_[hidden])
Date: 2010-02-23 16:26:16


Andrew Sutton-2 wrote:
>
>> I'm wondering if the documentation is incorrect. Perhaps it is just
>> imprecise, and removing any edge from the source vertex of an
>> adjacency_iterator invalidates that iterator?
>>
>> Anyone with additional insight would be very helpful.
>>
>
> That behavior should actually be correct since an adjacency iterator is
> just
> a wrapper around an out edge iterator. I haven't looked at the
> documentation
> on adjacency iterator invalidation, so it the docs may be incorrect.
>

That makes things a bit clearer.

However, in the code I provided, I'm incrementing the adjacency_iterator
prior to deleting the out edge to which it corresponds. My assumption was
that (when using listS) deletion of an out edge would invalidate an out_edge
iterator or an edge descriptor if and only if the iterator or descriptor
were pointing to the deleted element at the time of its deletion.

It seems, however, that deletion of any out edge invalidates the iterator.
Is that truly the case, or have I made a mistake? If it is the case, can
anyone explain why that limitation is required?

-- 
View this message in context: http://old.nabble.com/-BGL--adjacency_iterator-invalidation-with-adjacency_list%3ClistS%2C-listS%2C-unorderedS%3E-tp27647214p27710809.html
Sent from the Boost - Users mailing list archive at Nabble.com.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net