Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Graph of an Iterator
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-05-20 14:03:53


On Thu, 20 May 2010, Hossein Haeri wrote:

> Dear all,
>
> Is there any way to deduce the graph a graph-iterator is iterating over? So, for example for:
>
> typedef graph_type::vertex_iterator iterator;
> iterator begin, end;
> tie(begin, end) = vertices(g);
>
> is there anything like
>
> graph_type gg = graph_of(begin);
>
> so that gg == g?

That's not really possible, just like there is no mapping from STL
iterators to their corresponding paper. In some cases (I think actually
most of them), the vertex iterators of a graph don't have a reference to
the graph at all.

-- 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