Boost logo

Boost :

Subject: [boost] [Graph] LEDA adapter - concept check VertexListGraph fails
From: Jens Müller (blog_at_[hidden])
Date: 2011-12-18 16:56:08


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) );
   }

So, can someone enlighten me why it isn't found? Has it something to do
with

#ifdef BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
         // dwa 2003/7/11 -- This clearly shouldn't be necessary, but if
         // you want to use vector_as_graph, it is! I'm sure the graph
         // library leaves these out all over the place. Probably a
         // redesign involving specializing a template with a static
         // member function is in order :(
         using boost::vertices;
#endif

?

Best regards,

Jens


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