
On Jun 28, 2010, at 12:23 PM, Trevor Harmon wrote:
#include <boost/graph/adjacency_list.hpp> #include <boost/graph/subgraph.hpp>
using namespace boost;
class MyVertex { public: virtual ~MyVertex() {} };
class MyGraph : public subgraph<adjacency_list<vecS, vecS, bidirectionalS, shared_ptr<MyVertex>, property<edge_index_t, std::size_t> > > { };
typedef property_map<MyGraph, edge_index_t>::type EdgeIndexMap;
int main(int,char*[]) { MyGraph g; EdgeIndexMap edgeMap = get(edge_index, g); return 0; }
Hmm... If I change the EdgeIndexMap typedef so that MyGraph is simply replaced by its superclass, then the code compiles. That is, I change this: typedef property_map<MyGraph, edge_index_t>::type EdgeIndexMap; to this: typedef property_map<subgraph<adjacency_list<vecS, vecS, bidirectionalS, shared_ptr<MyVertex>, property<edge_index_t, std::size_t> > >, edge_index_t>::type EdgeIndexMap; I'm afraid my Boost-fu isn't very strong. Can someone please explain this to me? Thanks, Trevor