| 1 | #include <boost/graph/adjacency_list.hpp>
|
|---|
| 2 | #include <boost/property_map/dynamic_property_map.hpp>
|
|---|
| 3 |
|
|---|
| 4 | struct N1 { std::string _id; };
|
|---|
| 5 | struct N2 : public N1 {};
|
|---|
| 6 | struct C {};
|
|---|
| 7 |
|
|---|
| 8 | template<typename N>
|
|---|
| 9 | struct MyClass
|
|---|
| 10 | {
|
|---|
| 11 | typedef boost::adjacency_list<boost::listS, boost::listS,
|
|---|
| 12 | boost::bidirectionalS,
|
|---|
| 13 | N, C> graph_t;
|
|---|
| 14 | void test()
|
|---|
| 15 | {
|
|---|
| 16 | boost::dynamic_properties dp;
|
|---|
| 17 | graph_t g;
|
|---|
| 18 | dp.property("node_id", get(&N::_id, g));
|
|---|
| 19 | }
|
|---|
| 20 | };
|
|---|
| 21 |
|
|---|
| 22 | // this main compiles with boost 1.38 and boost 1.40
|
|---|
| 23 | // int main()
|
|---|
| 24 | // {
|
|---|
| 25 | // MyClass<N1> a;
|
|---|
| 26 | // a.test();
|
|---|
| 27 | // }
|
|---|
| 28 |
|
|---|
| 29 | // this ones compiles with boost 1.38 but not with boost 1.40
|
|---|
| 30 | int main()
|
|---|
| 31 | {
|
|---|
| 32 | MyClass<N2> a;
|
|---|
| 33 | a.test();
|
|---|
| 34 | }
|
|---|