Search code examples
c++boostboost-graph

C++ Boost:: How to create a map from vertex descriptor?


I tried to define map, but it doesn't let me to define:

....
typename graph_traits<MyGraphType>::vertex_descriptor NodeID;
typedef map<size_t, NodeID> IndexMap; //doesn't let me to create this
...
MyGraphType(10);
...
...

Solution

  • The typename doesn't look as if it belongs in your snippet. (Which is too short to say anything.) Try:

    typedef graph_traits<MyGraphType>::vertex_descriptor NodeID;