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 struct edge_info_t { };
17 namespace boost {
18   BOOST_INSTALL_PROPERTY(vertex, info);
19   BOOST_INSTALL_PROPERTY(edge, info);
20 };
21 
22 typedef property<vertex_info_t, double> vertex_properties;
23 typedef property<edge_info_t, double> edge_properties;
24 
25 typedef adjacency_list<vecS, vecS, bidirectionalS,
26 vertex_properties, edge_properties> graph_t;
27 
foo_1(graph_t & x)28 double& foo_1(graph_t& x)
29 {
30   property_map<graph_t, vertex_info_t>::type pmap
31     = get(vertex_info_t(), x);
32   return pmap[vertex(0, x)];
33 }
34 
foo_2(graph_t const & x)35 const double& foo_2(graph_t const & x)
36 {
37   property_map<graph_t, vertex_info_t>::const_type pmap
38     = get(vertex_info_t(), x);
39   return pmap[vertex(0, x)];
40 }
41 
bar_1(graph_t & x)42 double& bar_1(graph_t& x)
43 {
44   property_map<graph_t, edge_info_t>::type pmap
45     = get(edge_info_t(), x);
46   return pmap[edge(vertex(0, x), vertex(1, x), x).first];
47 }
48 
bar_2(graph_t const & x)49 const double& bar_2(graph_t const & x)
50 {
51   property_map<graph_t, edge_info_t>::const_type pmap
52     = get(edge_info_t(), x);
53   return pmap[edge(vertex(0, x), vertex(1, x), x).first];
54 }
55 
56 int
main()57 main()
58 {
59   return 0;
60 }
61