Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62070 - in sandbox/geometry: boost/geometry/algorithms/detail/overlay boost/geometry/util libs/geometry/example libs/geometry/test/geometries
From: barend.gehrels_at_[hidden]
Date: 2010-05-17 15:51:48


Author: barendgehrels
Date: 2010-05-17 15:51:46 EDT (Mon, 17 May 2010)
New Revision: 62070
URL: http://svn.boost.org/trac/boost/changeset/62070

Log:
Updates for clang
Text files modified:
   sandbox/geometry/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp | 2
   sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp | 32 ++++++++++----------
   sandbox/geometry/boost/geometry/util/reversible_view.hpp | 16 +++++-----
   sandbox/geometry/libs/geometry/example/07_graph_route_example.cpp | 60 +++++++++++++++++++++------------------
   sandbox/geometry/libs/geometry/test/geometries/segment.cpp | 1
   5 files changed, 58 insertions(+), 53 deletions(-)

Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp 2010-05-17 15:51:46 EDT (Mon, 17 May 2010)
@@ -194,7 +194,7 @@
         segment_identifier const& sr = right.subject.seg_id;
 
         return sl == sr
- ? compare_distances(left.subject, right.subject)
+ ? this->compare_distances(left.subject, right.subject)
             : sl < sr;
     }
 };

Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp 2010-05-17 15:51:46 EDT (Mon, 17 May 2010)
@@ -107,7 +107,7 @@
         static int const index_p = Index;
         static int const index_q = 1 - Index;
 
- int const side_qi_p = dir_info.sides.get<index_q, 0>();
+ int const side_qi_p = dir_info.sides.template get<index_q, 0>();
         int const side_qk_p = SideStrategy::apply(pi, pj, qk);
 
         if (side_qi_p == -side_qk_p)
@@ -217,7 +217,7 @@
         ti.method = method_touch;
         copy_coordinates(intersection_info.intersections[0], ti.point);
 
- int const side_qi_p1 = dir_info.sides.get<1, 0>();
+ int const side_qi_p1 = dir_info.sides.template get<1, 0>();
         int const side_qk_p1 = SideStrategy::apply(pi, pj, qk);
 
 
@@ -673,7 +673,7 @@
         // Union: take P
         // Intersection: take Q
         // Otherwise: vice versa
- int const side_qi_p1 = dir_info.sides.get<1, 0>();
+ int const side_qi_p1 = dir_info.sides.template get<1, 0>();
         int const index = side_qi_p1 == 1 ? 0 : 1;
         ti.operations[index].operation = operation_union;
         ti.operations[1 - index].operation = operation_intersection;
@@ -743,7 +743,7 @@
 
         typename strategy::return_type result = strategy::apply(p1, q1);
 
- char const method = result.get<1>().how;
+ char const method = result.template get<1>().how;
 
         // Copy, to copy possibly extended fields
         TurnInfo tp = tp_model;
@@ -767,16 +767,16 @@
> policy;
 
                 // If Q (1) arrives (1)
- if (result.get<1>().arrival[1] == 1)
+ if (result.template get<1>().arrival[1] == 1)
                 {
                     policy::template apply<0>(pi, pj, pk, qi, qj, qk,
- tp, result.get<0>(), result.get<1>());
+ tp, result.template get<0>(), result.template get<1>());
                 }
                 else
                 {
                     // Swap p/q
                     policy::template apply<1>(qi, qj, qk, pi, pj, pk,
- tp, result.get<0>(), result.get<1>());
+ tp, result.template get<0>(), result.template get<1>());
                 }
                 AssignPolicy::apply(tp, pi, qi);
                 *out++ = tp;
@@ -791,7 +791,7 @@
> policy;
 
                 policy::apply(pi, pj, pk, qi, qj, qk,
- tp, result.get<0>(), result.get<1>());
+ tp, result.template get<0>(), result.template get<1>());
                 AssignPolicy::apply(tp, pi, qi);
                 *out++ = tp;
             }
@@ -806,14 +806,14 @@
> policy;
 
                 policy::apply(pi, pj, pk, qi, qj, qk,
- tp, result.get<0>(), result.get<1>());
+ tp, result.template get<0>(), result.template get<1>());
                 AssignPolicy::apply(tp, pi, qi);
                 *out++ = tp;
             }
             break;
             case 'e':
             {
- if (! result.get<1>().opposite)
+ if (! result.template get<1>().opposite)
                 {
                     // Both equal
                     // or collinear-and-ending at intersection point
@@ -824,7 +824,7 @@
> policy;
 
                     policy::apply(pi, pj, pk, qi, qj, qk,
- tp, result.get<0>(), result.get<1>());
+ tp, result.template get<0>(), result.template get<1>());
                     AssignPolicy::apply(tp, pi, qi);
                     *out++ = tp;
                 }
@@ -834,10 +834,10 @@
             case 'c' :
             {
                 // Collinear
- if (! result.get<1>().opposite)
+ if (! result.template get<1>().opposite)
                 {
 
- if (result.get<1>().arrival[0] == 0)
+ if (result.template get<1>().arrival[0] == 0)
                     {
                         // Collinear, but similar thus handled as equal
                         equal
@@ -845,7 +845,7 @@
                                 TurnInfo,
                                 typename si::side_strategy_type
>::apply(pi, pj, pk, qi, qj, qk,
- tp, result.get<0>(), result.get<1>());
+ tp, result.template get<0>(), result.template get<1>());
 
                         // override assigned method
                         tp.method = method_collinear;
@@ -857,7 +857,7 @@
                                 TurnInfo,
                                 typename si::side_strategy_type
>::apply(pi, pj, pk, qi, qj, qk,
- tp, result.get<0>(), result.get<1>());
+ tp, result.template get<0>(), result.template get<1>());
                     }
 
                     AssignPolicy::apply(tp, pi, qi);
@@ -871,7 +871,7 @@
                             typename si::side_strategy_type,
                             AssignPolicy
>::apply(pi, pj, pk, qi, qj, qk,
- tp, out, result.get<0>(), result.get<1>());
+ tp, out, result.template get<0>(), result.template get<1>());
                 }
             }
             break;

Modified: sandbox/geometry/boost/geometry/util/reversible_view.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/util/reversible_view.hpp (original)
+++ sandbox/geometry/boost/geometry/util/reversible_view.hpp 2010-05-17 15:51:46 EDT (Mon, 17 May 2010)
@@ -37,11 +37,11 @@
     typedef typename boost::range_iterator<Range const>::type const_iterator;
     typedef typename boost::range_iterator<Range>::type iterator;
 
- const_iterator begin() const { return boost::begin(m_range); }
- const_iterator end() const { return boost::end(m_range); }
+ const_iterator begin() const { return boost::begin(this->m_range); }
+ const_iterator end() const { return boost::end(this->m_range); }
 
- iterator begin() { return boost::begin(m_range); }
- iterator end() { return boost::end(m_range); }
+ iterator begin() { return boost::begin(this->m_range); }
+ iterator end() { return boost::end(this->m_range); }
 private :
     Range& m_range;
 };
@@ -57,11 +57,11 @@
     typedef typename boost::range_reverse_iterator<Range const>::type const_iterator;
     typedef typename boost::range_reverse_iterator<Range>::type iterator;
 
- const_iterator begin() const { return boost::rbegin(m_range); }
- const_iterator end() const { return boost::rend(m_range); }
+ const_iterator begin() const { return boost::rbegin(this->m_range); }
+ const_iterator end() const { return boost::rend(this->m_range); }
 
- iterator begin() { return boost::rbegin(m_range); }
- iterator end() { return boost::rend(m_range); }
+ iterator begin() { return boost::rbegin(this->m_range); }
+ iterator end() { return boost::rend(this->m_range); }
 private :
     Range& m_range;
 };

Modified: sandbox/geometry/libs/geometry/example/07_graph_route_example.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/example/07_graph_route_example.cpp (original)
+++ sandbox/geometry/libs/geometry/example/07_graph_route_example.cpp 2010-05-17 15:51:46 EDT (Mon, 17 May 2010)
@@ -82,23 +82,23 @@
 
 
 // Code to define properties for Boost Graph's
-enum vertex_ggl_property_t { vertex_ggl_property };
-enum edge_ggl_property_t { edge_ggl_property };
+enum vertex_bg_property_t { vertex_bg_property };
+enum edge_bg_property_t { edge_bg_property };
 namespace boost
 {
- BOOST_INSTALL_PROPERTY(vertex, ggl_property);
- BOOST_INSTALL_PROPERTY(edge, ggl_property);
+ BOOST_INSTALL_PROPERTY(vertex, bg_property);
+ BOOST_INSTALL_PROPERTY(edge, bg_property);
 }
 
 // Define properties for vertex
 template <typename Point>
-struct ggl_vertex_property
+struct bg_vertex_property
 {
- ggl_vertex_property()
+ bg_vertex_property()
     {
         boost::geometry::assign_zero(location);
     }
- ggl_vertex_property(Point const& loc)
+ bg_vertex_property(Point const& loc)
     {
         location = loc;
     }
@@ -108,9 +108,9 @@
 
 // Define properties for edge
 template <typename Linestring>
-struct ggl_edge_property
+struct bg_edge_property
 {
- ggl_edge_property(Linestring const& line)
+ bg_edge_property(Linestring const& line)
         : m_line(line)
     {
         m_length = boost::geometry::length(line);
@@ -145,8 +145,8 @@
             = boost::add_vertex(graph);
 
         // Set the property (= location)
- boost::put(boost::get(vertex_ggl_property, graph), new_vertex,
- ggl_vertex_property<typename M::key_type>(key));
+ boost::put(boost::get(vertex_bg_property, graph), new_vertex,
+ bg_vertex_property<typename M::key_type>(key));
 
         // Add to the map, using POINT as key
         map[key] = new_vertex;
@@ -157,7 +157,6 @@
 
 template
 <
- typename Line,
     typename Graph,
     typename RoadTupleVector,
     typename CityTupleVector
@@ -166,7 +165,9 @@
             RoadTupleVector const& roads,
             CityTupleVector& cities)
 {
- typedef typename boost::geometry::point_type<Line>::type point_type;
+ typedef typename boost::range_value<RoadTupleVector>::type road_type;
+ typedef typename boost::tuples::element<0, road_type>::type line_type;
+ typedef typename boost::geometry::point_type<line_type>::type point_type;
 
     typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_type;
 
@@ -177,13 +178,13 @@
 
 
     // Fill the graph
- typedef typename boost::range_value<RoadTupleVector>::type road_type;
     BOOST_FOREACH(road_type const& road, roads)
     {
+ line_type const& line = road.template get<0>();
         // Find or add begin/end point of these line
- vertex_type from = find_or_insert(map, road.get<0>().front(), graph);
- vertex_type to = find_or_insert(map, road.get<0>().back(), graph);
- boost::add_edge(from, to, ggl_edge_property<Line>(road.get<0>()), graph);
+ vertex_type from = find_or_insert(map, line.front(), graph);
+ vertex_type to = find_or_insert(map, line.back(), graph);
+ boost::add_edge(from, to, bg_edge_property<line_type>(line), graph);
     }
 
     // Find nearest graph vertex for each city, using the map
@@ -193,12 +194,12 @@
         double min_distance = 1e300;
         for(typename map_type::const_iterator it = map.begin(); it != map.end(); ++it)
         {
- double dist = boost::geometry::distance(it->first, city.get<0>());
+ double dist = boost::geometry::distance(it->first, city.template get<0>());
             if (dist < min_distance)
             {
                 min_distance = dist;
                 // Set the vertex
- city.get<2>() = it->second;
+ city.template get<2>() = it->second;
             }
         }
     }
@@ -218,11 +219,11 @@
     if (opt_edge.second)
     {
         // Get properties of edge and of vertex
- ggl_edge_property<Route> const& edge_prop =
- boost::get(boost::get(edge_ggl_property, graph), opt_edge.first);
+ bg_edge_property<Route> const& edge_prop =
+ boost::get(boost::get(edge_bg_property, graph), opt_edge.first);
 
- ggl_vertex_property<typename boost::geometry::point_type<Route>::type> const& vertex_prop =
- boost::get(boost::get(vertex_ggl_property, graph), vertex2);
+ bg_vertex_property<typename boost::geometry::point_type<Route>::type> const& vertex_prop =
+ boost::get(boost::get(vertex_bg_property, graph), vertex2);
 
         // Depending on how edge connects to vertex, copy it forward or backward
         if (boost::geometry::equals(edge_prop.line().front(), vertex_prop.location))
@@ -261,7 +262,10 @@
 int main()
 {
     // Define a point in the Geographic coordinate system
- typedef boost::geometry::point<double, 2, boost::geometry::cs::geographic<boost::geometry::degree> > point_type;
+ typedef boost::geometry::point
+ <
+ double, 2, boost::geometry::cs::geographic<boost::geometry::degree>
+ > point_type;
 
     typedef boost::geometry::linestring<point_type> line_type;
 
@@ -269,8 +273,8 @@
     typedef boost::adjacency_list
         <
             boost::vecS, boost::vecS, boost::undirectedS
- , boost::property<vertex_ggl_property_t, ggl_vertex_property<point_type> >
- , boost::property<edge_ggl_property_t, ggl_edge_property<line_type> >
+ , boost::property<vertex_bg_property_t, bg_vertex_property<point_type> >
+ , boost::property<edge_bg_property_t, bg_edge_property<line_type> >
> graph_type;
 
     typedef boost::graph_traits<graph_type>::vertex_descriptor vertex_type;
@@ -294,7 +298,7 @@
     graph_type graph;
 
     // Add roads and connect cities
- add_roads_and_connect_cities<line_type>(graph, roads, cities);
+ add_roads_and_connect_cities(graph, roads, cities);
 
     double const km = 1000.0;
     std::cout << "distances, all in KM" << std::endl
@@ -315,7 +319,7 @@
         // Call Dijkstra (without named-parameter to be compatible with all VC)
         boost::dijkstra_shortest_paths(graph, city1.get<2>(),
                 &predecessors[0], &costs[0],
- boost::get(edge_ggl_property, graph),
+ boost::get(edge_bg_property, graph),
                 boost::get(boost::vertex_index, graph),
                 std::less<double>(), std::plus<double>(),
                 (std::numeric_limits<double>::max)(), double(),

Modified: sandbox/geometry/libs/geometry/test/geometries/segment.cpp
==============================================================================
--- sandbox/geometry/libs/geometry/test/geometries/segment.cpp (original)
+++ sandbox/geometry/libs/geometry/test/geometries/segment.cpp 2010-05-17 15:51:46 EDT (Mon, 17 May 2010)
@@ -112,3 +112,4 @@
 
     return 0;
 }
+


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk