________________________________ From: breadbread1984
To: boost-users@lists.boost.org Sent: Thursday, July 23, 2015 4:25 AM Subject: [Boost-users] problem of getting vertex_index_t property with BGL I am using boost graph library. I found there is a built in property vertex_index_t corresponding to every vertex from the document [here](http://www.boost.org/doc/libs/1_58_0/libs/graph/doc/adjacency_list.html). But when I get the vertex_index_t property the compiler prompt the following error:
CooperativeGraph.h:59:36: required from here /usr/include/boost/graph/detail/adjacency_list.hpp:2498:29: error: forming reference to void typedef value_type& reference; ^ /usr/include/boost/graph/detail/adjacency_list.hpp:2499:35: error: forming reference to void typedef const value_type& const_reference; ^ /usr/include/boost/graph/detail/adjacency_list.hpp:2502:47: error: forming reference to void
type; ^ /usr/include/boost/graph/detail/adjacency_list.hpp:2504:53: error: forming reference to void const_type; ^ CooperativeGraph.cpp: In member function ‘void CooperativeGraph::getProperties()’: CooperativeGraph.cpp:384:35: error: no matching function for call to ‘get(boost::vertex_index_t, Graph&)’ vertex_index = get(vertex_index,g); ^ I defined the data structure as follows typedef property
vertex_state;
typedef property
edge_qfunction; typedef adjacency_list< vecS,setS,directedS, vertex_state, edge_qfunction Graph;
Does anyone know what I am doing wrong? Why can't I get the vertex_index_t property. Thanks!
Your graph type has setS as its vertex container. Try using vecS instead to get the vertex_index property to be present. -- Jeremiah Willcock