1 | //======================================================================= |
2 | // Copyright 2002 Indiana University. |
3 | // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek |
4 | // |
5 | // Distributed under the Boost Software License, Version 1.0. (See |
6 | // accompanying file LICENSE_1_0.txt or copy at |
7 | // http://www.boost.org/LICENSE_1_0.txt) |
8 | //======================================================================= |
9 | |
10 | #include <boost/graph/properties.hpp> |
11 | #include <boost/graph/adjacency_list.hpp> |
12 | |
13 | using namespace boost; |
14 | |
15 | struct vertex_info_t |
16 | { |
17 | }; |
18 | struct edge_info_t |
19 | { |
20 | }; |
21 | namespace boost |
22 | { |
23 | BOOST_INSTALL_PROPERTY(vertex, info); |
24 | BOOST_INSTALL_PROPERTY(edge, info); |
25 | }; |
26 | |
27 | typedef property< vertex_info_t, double > vertex_properties; |
28 | typedef property< edge_info_t, double > edge_properties; |
29 | |
30 | typedef adjacency_list< vecS, vecS, bidirectionalS, vertex_properties, |
31 | edge_properties > |
32 | graph_t; |
33 | |
34 | double& foo_1(graph_t& x) |
35 | { |
36 | property_map< graph_t, vertex_info_t >::type pmap = get(p: vertex_info_t(), g&: x); |
37 | return pmap[vertex(n: 0, x)]; |
38 | } |
39 | |
40 | const double& foo_2(graph_t const& x) |
41 | { |
42 | property_map< graph_t, vertex_info_t >::const_type pmap |
43 | = get(p: vertex_info_t(), g: x); |
44 | return pmap[vertex(n: 0, x)]; |
45 | } |
46 | |
47 | double& bar_1(graph_t& x) |
48 | { |
49 | property_map< graph_t, edge_info_t >::type pmap = get(p: edge_info_t(), g&: x); |
50 | return pmap[edge(u: vertex(n: 0, x), v: vertex(n: 1, x), g_: x).first]; |
51 | } |
52 | |
53 | const double& bar_2(graph_t const& x) |
54 | { |
55 | property_map< graph_t, edge_info_t >::const_type pmap |
56 | = get(p: edge_info_t(), g: x); |
57 | return pmap[edge(u: vertex(n: 0, x), v: vertex(n: 1, x), g_: x).first]; |
58 | } |
59 | |
60 | int main() { return 0; } |
61 | |