Boost logo

Boost :

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


On Sun, 18 Dec 2011, Jens Müller wrote:

> Hi everyone,
>
> when running the tests for Graph, the first concept check in
> leda_graph_cc.cpp fails:
>
> gcc.compile.c++
> ../../../bin.v2/libs/graph/test/leda_graph_cc.test/gcc-4.6.1/debug/leda_graph_cc.o
> In file included from leda_graph_cc.cpp:9:0:
> ../../../boost/graph/graph_concepts.hpp: In destructor
> 'boost::concepts::VertexListGraph<G>::~VertexListGraph() [with G =
> leda::GRAPH<int, int>]':
> ../../../boost/graph/graph_concepts.hpp:168:1: instantiated from 'static
> void boost::concepts::requirement<boost::concepts::failed************
> Model::************>::failed() [with Model =
> boost::concepts::VertexListGraphConcept<leda::GRAPH<int, int> >]'
> leda_graph_cc.cpp:21:5: instantiated from here
> ../../../boost/graph/graph_concepts.hpp:189:9: error: no matching function
> for call to 'vertices(leda::GRAPH<int, int>&)'
> ../../../boost/graph/graph_concepts.hpp:189:9: note: candidate is:
> ../../../boost/graph/graph_concepts.hpp:45:48: note: template<class T>
> typename T::ThereReallyIsNoMemberByThisNameInT boost::vertices(const T&)
>
>
> (among some further errors, but I'd like to ask just about this one now)
>
> Apparently it cannot find a vertices() function:
>
> ../../../boost/graph/graph_concepts.hpp:189:9: error: no matching function
> for call to 'vertices(leda::GRAPH<int, int>&)'
>
>
> But there is one in leda_graph.hpp:
>
> 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) );
> }

That function is in the boost namespace, so it won't be found when
searching for an unqualified call to vertices() (which is what algorithms
are supposed to use). You might need to do something like the ADL hack
you mentioned (pulling those functions into the global namespace) to get
the concept check to pass.

-- Jeremiah Willcock


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