Boost logo

Boost Users :

Subject: [Boost-users] Extend boost::adjacency_list
From: Jupp Tscheak (jupp.tscheak_at_[hidden])
Date: 2011-10-03 12:39:54


Dear users of boost graph library,

I would like to extend boost::adjacency_list like this

code:
class MyGraph:
    public boost::adjacency_list<boost::multisetS,
                                 boost::vecS,
                                 boost::bidirectionalS,
                                 boost::property<boost::some_vertex_property, SomeVertexProperty*>,
                                 boost::property<boost::some_edge_property, SomeEdgeProperty*> {}

This works as expected.

Is it possible to extend class "MyGraph" with additional vertex and/or edge properties defined?

My first approach was like this

code:
template <class AdditionalVertexProperty = boost::no_property, class AdditionalEdgeProperty = boost::no_property>
class MyGraph:
    public boost::adjacency_list<boost::multisetS,
                                 boost::vecS,
                                 boost::bidirectionalS,
                                 boost::property<boost::some_vertex_property, SomeVertexProperty*, AdditionalVertexProperty>,
                                 boost::property<boost::some_edge_property, SomeEdgeProperty*, AdditionalEdgeProperty> {}

class ExtendedMyGraph: public MyGraph<boost::property<boost::some_add_vertex_property, SomeAddVertexProperty*> > {}

This, however, led into multiple compiler errors. Does anyone know how to achieve the wanted behavior?

Thanks in advance

Jupp



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