Boost logo

Boost Users :

From: kweeheong (tan.k.h_at_[hidden])
Date: 2002-11-08 17:35:43


When I create a reverse_graph from a graph, is it possible to get the
property map as well?

I have reduced the code to the following snippet:

   typedef adjacency_list<vecS, vecS, bidirectionalS, property<vertex_name_t,string> > GraphType;
   typedef boost::property_map<GraphType,vertex_name_t>::type VertexNameMapType;
   typedef reverse_graph<GraphType> ReverseGraphType;
   typedef boost::property_map<ReverseGraphType,vertex_name_t>::type ReverseVertexNameMapType;

   GraphType g;
   VertexNameMapType nameMap=get(vertex_name,g); // get nameMap from graph g
   reverse_graph<GraphType> rg(g); // create the reverse_graph
   ReverseVertexNameMapType rnameMap=boost::get(vertex_name,rg); // get rnameMap frmo rg, but this line fails to compile

The VC6 compile error message, with long substrings substituted for string ( STR ) and adjacency list ( ADJL ) looks like:

   graph\reverse_graph.hpp(241) : error C2664: '__thiscall boost::vec_adj_list_vertex_property_map<A,A*,S,S&,vertex_name_t>::boost::vec_adj_list_vertex_property_map<A,A*,S,S&,vertex_name_t><class boost::ADJL *>' : cannot convert parameter 1 from 'struct boost::vec_adj_list_vertex_property_map<class boost::ADJL,class boost::ADJL const *,class STR,class STR const &,enum boost::vertex_name_t>' to 'class boost::ADJL *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
   example\testreverse.cpp(97) : see reference to function template instantiation 'struct boost::vec_adj_list_vertex_property_map<A,A*,S,S&,vertex_name_t> __cdecl boost::get<enum boost::vertex_name_t,class boost::reverse_graph<class boost::ADJL,class boost::ADJL const &> &>' being compiled
   graph\reverse_graph.hpp(241) : error C2553: no legal conversion of return value to return type 'struct boost::vec_adj_list_vertex_property_map<A,A*,S,S&,vertex_name_t> *'
   example\testreverse.cpp(97) : see reference to function template instantiation 'struct boost::vec_adj_list_vertex_property_map<A,A*,S,S&,vertex_name_t> __cdecl boost::get<enum boost::vertex_name_t,class boost::reverse_graph<class boost::ADJL,class boost::ADJL const &> &>' being compiled

I am trying to determine whether I have made the call incorrectly or is this a limitation of the reverse_graph?


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