|
Boost Users : |
Subject: Re: [Boost-users] [BGL] iterator/descriptor invalidation
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2008-12-10 11:14:20
>
> 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.
>
You're right... It probably invalidates all out edge and adjacency iterators
- but not descriptors!
If you want to make your brain hurt, you could try to figure out why, under
certain conditions for the directed graph, adjacency_iterators appear to be
valid, while out_edge_iterators are not. I've been looking at it for an hour
or so and can't figure it out. My guess is its just some random memory
utilization artifact.
You might be surprised to learn that the vertex_iterator for VertexSet ==
VecS is actually integer_range<size_t>::iterator. It's just dereferencing to
integers.
Andrew Sutton
andrew.n.sutton_at_[hidden]
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