1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/stdcpp/tsrc/Boost_test/graph/src/lvalue_pmap.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,74 @@
1.4 +//=======================================================================
1.5 +// Copyright 2002 Indiana University.
1.6 +// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
1.7 +//
1.8 +// Distributed under the Boost Software License, Version 1.0. (See
1.9 +// accompanying file LICENSE_1_0.txt or copy at
1.10 +// http://www.boost.org/LICENSE_1_0.txt)
1.11 +//=======================================================================
1.12 +
1.13 +/*
1.14 + * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.15 +*/
1.16 +
1.17 +#include <boost/graph/properties.hpp>
1.18 +#include <boost/graph/adjacency_list.hpp>
1.19 +#ifdef __SYMBIAN32__
1.20 +#include "std_log_result.h"
1.21 +#define LOG_FILENAME_LINE __FILE__, __LINE__
1.22 +#endif
1.23 +using namespace boost;
1.24 +
1.25 +struct vertex_info_t { };
1.26 +struct edge_info_t { };
1.27 +namespace boost {
1.28 + BOOST_INSTALL_PROPERTY(vertex, info);
1.29 + BOOST_INSTALL_PROPERTY(edge, info);
1.30 +};
1.31 +
1.32 +typedef property<vertex_info_t, double> vertex_properties;
1.33 +typedef property<edge_info_t, double> edge_properties;
1.34 +
1.35 +typedef adjacency_list<vecS, vecS, bidirectionalS,
1.36 +vertex_properties, edge_properties> graph_t;
1.37 +
1.38 +double& foo_1(graph_t& x)
1.39 +{
1.40 + property_map<graph_t, vertex_info_t>::type pmap
1.41 + = get(vertex_info_t(), x);
1.42 + return pmap[vertex(0, x)];
1.43 +}
1.44 +
1.45 +const double& foo_2(graph_t const & x)
1.46 +{
1.47 + property_map<graph_t, vertex_info_t>::const_type pmap
1.48 + = get(vertex_info_t(), x);
1.49 + return pmap[vertex(0, x)];
1.50 +}
1.51 +
1.52 +double& bar_1(graph_t& x)
1.53 +{
1.54 + property_map<graph_t, edge_info_t>::type pmap
1.55 + = get(edge_info_t(), x);
1.56 + return pmap[edge(vertex(0, x), vertex(1, x), x).first];
1.57 +}
1.58 +
1.59 +const double& bar_2(graph_t const & x)
1.60 +{
1.61 + property_map<graph_t, edge_info_t>::const_type pmap
1.62 + = get(edge_info_t(), x);
1.63 + return pmap[edge(vertex(0, x), vertex(1, x), x).first];
1.64 +}
1.65 +
1.66 +int
1.67 +main()
1.68 +{
1.69 +
1.70 +#ifdef __SYMBIAN32__
1.71 +std_log(LOG_FILENAME_LINE,"[End Test Case ]");
1.72 +
1.73 + testResultXml("lvalue_pmap");
1.74 + close_log_file();
1.75 +#endif
1.76 + return 0;
1.77 +}