
I'm having some problems with the Boost Graph library in 1.42.
Specifically, if I include the graph concepts header before declaring my
overloads of vertices, out_edges et al, the compiler can't see my
overloads. I've produced a small-ish test case (below) which doesn't
compile with g++ 4.4.3. (It's not supposed to link...)
In file included from test.cpp:3:
/home/srk31/opt/include/boost/graph/graph_concepts.hpp: In destructor ?boost::concepts::VertexListGraph<G>::~VertexListGraph() [with G = Gr]?:
/home/srk31/opt/include/boost/graph/graph_concepts.hpp:166: instantiated from ?static void boost::concept::requirement<Model>::failed() [with Model = boost::concepts::VertexListGraphConcept<Gr>]?
/home/srk31/opt/include/boost/concept_check.hpp:43: instantiated from ?void boost::function_requires(Model*) [with Model = boost::concepts::VertexListGraphConcept<Gr>]?
test.cpp:49: instantiated from here
/home/srk31/opt/include/boost/graph/graph_concepts.hpp:187: error: no matching function for call to ?vertices(Gr&)?
/home/srk31/opt/include/boost/graph/graph_concepts.hpp: In member function ?void boost::concepts::VertexListGraph<G>::const_constraints(const G&) [with G = Gr]?:
/home/srk31/opt/include/boost/graph/graph_concepts.hpp:189: instantiated from ?boost::concepts::VertexListGraph<G>::~VertexListGraph() [with G = Gr]?
/home/srk31/opt/include/boost/graph/graph_concepts.hpp:166: instantiated from ?static void boost::concept::requirement<Model>::failed() [with Model = boost::concepts::VertexListGraphConcept<Gr>]?
/home/srk31/opt/include/boost/concept_check.hpp:43: instantiated from ?void boost::function_requires(Model*) [with Model = boost::concepts::VertexListGraphConcept<Gr>]?
test.cpp:49: instantiated from here
/home/srk31/opt/include/boost/graph/graph_concepts.hpp:201: error: no matching function for call to ?vertices(const Gr&)?
What's odd is that if I move the #include of
boost/graph/graph_concepts.hpp to *below* my overloads, it does work.
However, that code reordering is not an option in the actual context
where I'm having this problem.
Can anyone see anything wrong with my code, or verify that they do or
don't see the same problem? I'm thinking it's a compiler bug but am not
sure... will file it in gcc bugzilla if I'm not proved wrong here. It
does build successfully with g++ 4.1.2. If anyone knows a workaround, or
has other suggestions, I'd be very grateful. Anyway, thanks for reading!
Stephen
#include <utility>
#include