T
Tim Frink
Hi,
I've a question about Boost Library Graphs; maybe
this is somehow off-topic but I didn't find any
more appropriate NG.
My Boost Graph is defined as:
typedef boost::adjacency_list< boost::vecS, boost::vecS,
boost::directedS,
boost:roperty< boost::graph_name_t, std::string >,
boost:roperty< boost::vertex_index_t, ClassA* > > Boost_Graph;
So, I want to have a pointer to an entity of class ClassA
as vertex property "vertex_index".
However, when I try to access this property via a property map
boost:roperty_map< Boost_Graph, boost::vertex_index_t >::type
vertexNameMap = get( boost::vertex_index, g );
with
vertexNameMap[v]
(where v is Vertex_Type)
the compiler tells me that the property is not of type 'ClassA*' (as I
would expect) but of type 'size_t'. Why? I thought that for the
definition of
boost:roperty< boost::vertex_index_t, ClassA* >
ClassA* is the template value and defines the type of the property
"vertex_index".
Any ideas how I can manage it to store pointers as vertex property?
Regards,
Tim
I've a question about Boost Library Graphs; maybe
this is somehow off-topic but I didn't find any
more appropriate NG.
My Boost Graph is defined as:
typedef boost::adjacency_list< boost::vecS, boost::vecS,
boost::directedS,
boost:roperty< boost::graph_name_t, std::string >,
boost:roperty< boost::vertex_index_t, ClassA* > > Boost_Graph;
So, I want to have a pointer to an entity of class ClassA
as vertex property "vertex_index".
However, when I try to access this property via a property map
boost:roperty_map< Boost_Graph, boost::vertex_index_t >::type
vertexNameMap = get( boost::vertex_index, g );
with
vertexNameMap[v]
(where v is Vertex_Type)
the compiler tells me that the property is not of type 'ClassA*' (as I
would expect) but of type 'size_t'. Why? I thought that for the
definition of
boost:roperty< boost::vertex_index_t, ClassA* >
ClassA* is the template value and defines the type of the property
"vertex_index".
Any ideas how I can manage it to store pointers as vertex property?
Regards,
Tim