Boost logo

Boost Users :

Subject: [Boost-users] [Graph] Descriptor invalidation on remove_vertex() with adjacency_list VL=vecS
From: Chris Dellin (cdellin_at_[hidden])
Date: 2015-08-13 17:59:45


The documentation for the adjacency_list [0] is clear that if the vertex
list container is vecS, then calling remove_vertex() will invalidate any
vertex/edge descriptors into the graph.

However, I was wondering if this is actually the case if the removed vertex
was the one most recently added, that is,
remove_vertex(vertex(num_vertices(g)-1)). In this case, I would think that
no shifting of vertex data or adjustment of edge source/target indices
would be necessary, and existing descriptors are guaranteed to be still

Is this safe to do with the current implementation? If not, why not?

- Chris Dellin


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at