Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost-users][graph] There is graph::null_vertex, but no "null_edge"!
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-02-17 17:47:39


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net