
Andrew Sutton escribió:
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?
Looks like everything works fine with undirected graph, i.e., this code
does not lead to segfault:
#include <iostream>
#include