Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] iterator/descriptor invalidation
From: Julius Ziegler (ziegler_at_[hidden])
Date: 2008-12-10 10:21:12


Andrew Sutton <andrew.n.sutton <at> gmail.com> writes:

> I was going to update the documentation, but decided to test a little more
> thoroughly as to what is and is not actually invalidated when you add a
> vertex.
> Here are the somewhat surprising results:<vecS, vecS, undirectedS> - nothing
> invalidated<vecS, vecS, directedS> - edge iterators are invalidated, nothing
> else<vecS, vecS, bidrectionalS> - nothing invliadatedThe test file is in trunk
> at libs/graphs/test/adj_list_invalidaton.cpp. It's not comprehensive, but
> will segfault as indicated above.
>
> Andrew Suttonandrew.n.sutton <at> gmail.com

For completeness: the outcome is exactly the same if you use
OutEdgeList = listS. To me, the surprising thing is that vertex_iterators are
so stable when adding vertices. I believe that vertex_iterator is just a
vertex_descriptor in disguise, that, when dereferenced, does "normal" indexing
(via operator[]) into the vertex storage.

Regards,
Julius
  


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