Boost logo

Boost Users :

Subject: [Boost-users] problem of getting vertex_index_t property with BGL
From: breadbread1984 (breadbread1984_at_[hidden])
Date: 2015-07-23 06:25:39


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
           <Graph, value_type, reference, Tag> type;
                                               ^
/usr/include/boost/graph/detail/adjacency_list.hpp:2504:53: error: forming reference to void
           <Graph, value_type, const_reference, Tag> 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_BatteryLevel_t,int,
        property<vertex_ObservationHistory_t,deque<Observation>,
                property<vertex_name_t,uuid>
>
> vertex_state;
typedef property<edge_QFunction_t,QTable,
        property<edge_Eligibility_t,Eligibility>
> 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!


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