[BGL] read_graphml fails at compilation but MutableGraph concept test succeeds

Look at this (shortened) code fragment: namespace boost { ... Node* add_vertex(HalfedgeGraph& g) { Node* n = new Node(); g.AddNode(n); return n; } ... } int main(int argc, char* argv[]) { // #1 boost::function_requires< boost::MutableGraphConcept<HalfedgeGraph> >(); std::ifstream ifile("test_input.xml"); boost::dynamic_properties dp; HalfedgeGraph g; // #2 boost::read_graphml(ifile, g, dp); return 0; } The concept test at #1 (calling Node* add_vertex(HalfedgeGraph&)) succeeds (if I remove or alter the add_vertex function it fails as expected), but the read_graphml function at #2 doesn't compile telling me that add_vertex(HalfedgeGraph&) isn't compiled. How come the partial graph_traits specialization works for the concept-test-class but not for the graphml reader? (The HalfedgeGraph class did prove correct in the past and the graph_traits<HalfedgeGraph>::vertex_descriptor is a typedef for Node*) Greetings, Paul Hilbert

AMDG Paul Hilbert wrote:
Look at this (shortened) code fragment:
namespace boost { ... Node* add_vertex(HalfedgeGraph& g) { Node* n = new Node(); g.AddNode(n); return n; } ... }
<snip>
The concept test at #1 (calling Node* add_vertex(HalfedgeGraph&)) succeeds (if I remove or alter the add_vertex function it fails as expected), but the read_graphml function at #2 doesn't compile telling me that add_vertex(HalfedgeGraph&) isn't compiled. How come the partial graph_traits specialization works for the concept-test-class but not for the graphml reader?
(The HalfedgeGraph class did prove correct in the past and the graph_traits<HalfedgeGraph>::vertex_descriptor is a typedef for Node*)
add_vertex needs to be in an associated namespace of HalfedgeGraph or ADL can't find it. In Christ, Steven Watanabe
participants (2)
-
Paul Hilbert
-
Steven Watanabe