
17 Feb
2011
17 Feb
'11
10:47 p.m.
On Thu, 17 Feb 2011, al.zatv wrote:
Hello!
There is graph::null_vertex, but no "null_edge". Atl east, I don't find it. How can I return such a "special" edge descriptor, to mark,for example, that edge is not found or something like that?
It looks like you are correct. The BGL functions that can return non-existent edges return iterators instead, in which case edges(g).end() is a legitimate "null" return value. If you know the graph is non-empty, you can also return std::pair<edge_descriptor, bool>, returning make_pair(*edges(g).first, false) for the "not found" case and make_pair(..., true) otherwise. -- Jeremiah Willcock