Ticket #4495: xxx.cpp

File xxx.cpp, 756 bytes (added by Thomas Krennwallner <tkren@…>, 12 years ago)

Working example without dynamic_bitset

Line 
1/// "minimal" example using dynamic_properties, does nothing, but compiles
2
3#include <boost/shared_ptr.hpp>
4#include <boost/graph/adjacency_list.hpp>
5#include <boost/graph/graphviz.hpp>
6
7typedef boost::shared_ptr<int> my_t;
8
9inline std::istream& operator>> (std::istream& is, my_t&) { return is; }
10
11typedef boost::property< boost::graph_name_t, my_t > graph_p;
12typedef boost::adjacency_list < boost::vecS, boost::vecS, boost::directedS,
13 boost::no_property, boost::no_property, graph_p > graph_t;
14
15typedef boost::ref_property_map<graph_t*, my_t> gname_p;
16
17int main()
18{
19 graph_t g(0);
20 boost::dynamic_properties dp;
21 gname_p gname(boost::get_property(g, boost::graph_name));
22 dp.property("name", gname);
23}
24
25// Local Variables:
26// mode: C++
27// End: