In the provided example
g.m_vertices.reserve(6)
helps.

You're right... That should work - unless you're adding more than 6 vertices.

Maybe we should provide a reserve_vertices(g, n) function for the vertex set on adjacency lists. It's a nice optimization and apparently can help avoid some invalidation. Obviously it only applies to VertexSet == vecS || listS. Thoughts?

Andrew Sutton
andrew.n.sutton@gmail.com