Boost logo

Boost Users :

Subject: [Boost-users] [BGL] read_graphml fails at compilation but MutableGraph concept test succeeds
From: Paul Hilbert (vock_at_[hidden])
Date: 2009-06-02 07:27:54


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net