|
Boost : |
Subject: Re: [boost] [Graph] LEDA adapter - concept check VertexListGraph fails
From: Jens Müller (blog_at_[hidden])
Date: 2011-12-18 18:58:58
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).
Should this really be order-dependent? If yes, should it be documented
somewhere?
- Jens
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk