What I can't see is what will happen when the endpoints don't fall in [0, n). Is that documented somewhere?

I don't think so.  It's basically undefined behavior -- it usually ends up in an out-of-bounds array access and thus likely a crash.

In the case of the constructor, it may. In the case of add_edge (with the vertex list == vecS), adjacency_list will automatically resize -- I think I remember being surprised with this before :) It's probably worth looking at before taking my word for it.

Andrew Sutton
andrew.n.sutton@gmail.com