Boost logo

Boost :

Subject: Re: [boost] [Graph] LEDA adapter - concept check VertexListGraph fails
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-12-18 19:54:55

On Mon, 19 Dec 2011, Jens Müller wrote:

> On 18.12.2011 23:36, Jeremiah Willcock wrote:
>> I think the LEDA adapter will require some kind of namespace import even
>> with a conforming compiler.
> This is the function that should be found:
> namespace boost {
> template <class vtype, class etype>
> inline std::pair<
> typename graph_traits< leda::GRAPH<vtype,etype> >::vertex_iterator,
> typename graph_traits< leda::GRAPH<vtype,etype> >::vertex_iterator >
> vertices(const leda::GRAPH<vtype,etype>& g)
> {
> typedef typename graph_traits< leda::GRAPH<vtype,etype>
>> ::vertex_iterator
> Iter;
> return std::make_pair( Iter(g.first_node(),&g), Iter(0,&g) );
> }
> } // namespace boost
> I now tried out something different. I wondered about this comment: "It is
> needed in order to allow us to write using boost::vertices as needed for ADL
> when using vector_as_graph below.", and my idea was "so that a function of
> that name is indeed defined" ...
> I switched the order of the imports in leda_graph_cc.cpp:
> #include <boost/graph/leda_graph.hpp>
> #include <boost/graph/graph_concepts.hpp>
> and indeed, this bug is gone (there is another one in the same concept check,
> but I will deal with it later).

It is supposed to work in the other order; please try turning off
BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK and flip the header order back and
see what happens. It probably won't work, but I think that's what the
standard says is supposed to happen. It would be nicer (and probably
work) if the LEDA wrappers were in the leda namespace (same as the graph
types), although that isn't elegant because of modifying a third-party
library's namespace.

-- Jeremiah Willcock

Boost list run by bdawes at, gregod at, cpdaniel at, john at