Boost logo

Boost :

Subject: Re: [boost] [graph] VertexListGraph and InputIterator, and LEDA graph
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2012-01-02 10:39:14


On Sun, 1 Jan 2012, Jens Müller wrote:

> Hi all,
>
> I'm currently fixing up leda_graph.hpp so it passes the tests, or indeed,
> fixing the tests ...
>
> A leda::GRAPH<int,int> (=Graph) has to fulfill VertexListGraphConcept. This
> means that boost::graph_traits<G>::vertex_iterator has to be a
> MultiPassInputIterator, i.e., also a InputIterator.
>
> I cannot read from http://www.sgi.com/tech/stl/InputIterator.html that it
> must be possible that you can compute the difference between two iterators.
>
> But apparently the concept check (which fails) requires a difference type,
> which must be a signed integer. Is this a bug in the concept check?

You need the difference_type defined (to be the result of std::distance,
for example) but not the operator-() to compute the distance itself (nor
the other random access operators such as +).

-- Jeremiah Willcock


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk