Update contrib.
1 //=======================================================================
2 // Copyright 2002 Indiana University.
3 // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
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 //=======================================================================
11 * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
14 #include <boost/graph/properties.hpp>
15 #include <boost/graph/adjacency_list.hpp>
17 #include "std_log_result.h"
18 #define LOG_FILENAME_LINE __FILE__, __LINE__
20 using namespace boost;
22 struct vertex_info_t { };
23 struct edge_info_t { };
25 BOOST_INSTALL_PROPERTY(vertex, info);
26 BOOST_INSTALL_PROPERTY(edge, info);
29 typedef property<vertex_info_t, double> vertex_properties;
30 typedef property<edge_info_t, double> edge_properties;
32 typedef adjacency_list<vecS, vecS, bidirectionalS,
33 vertex_properties, edge_properties> graph_t;
35 double& foo_1(graph_t& x)
37 property_map<graph_t, vertex_info_t>::type pmap
38 = get(vertex_info_t(), x);
39 return pmap[vertex(0, x)];
42 const double& foo_2(graph_t const & x)
44 property_map<graph_t, vertex_info_t>::const_type pmap
45 = get(vertex_info_t(), x);
46 return pmap[vertex(0, x)];
49 double& bar_1(graph_t& x)
51 property_map<graph_t, edge_info_t>::type pmap
52 = get(edge_info_t(), x);
53 return pmap[edge(vertex(0, x), vertex(1, x), x).first];
56 const double& bar_2(graph_t const & x)
58 property_map<graph_t, edge_info_t>::const_type pmap
59 = get(edge_info_t(), x);
60 return pmap[edge(vertex(0, x), vertex(1, x), x).first];
68 std_log(LOG_FILENAME_LINE,"[End Test Case ]");
70 testResultXml("lvalue_pmap");