From 4c5d4d08cdb28ac54307f1d8ce9fb89ff675564e Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Sun, 13 Oct 2024 20:33:41 +0200 Subject: [PATCH] chore: change point_type to point_type_t and use 'using' at those places --- .../detail/buffer/buffer_inserter.hpp | 12 ++--- .../detail/buffer/implementation.hpp | 4 +- .../closest_feature/geometry_to_range.hpp | 10 +--- .../detail/closest_feature/range_to_range.hpp | 6 +-- .../linear_or_areal_to_areal.hpp | 10 ++-- .../closest_points/linear_to_linear.hpp | 6 +-- .../closest_points/multipoint_to_geometry.hpp | 4 +- .../closest_points/point_to_geometry.hpp | 2 +- .../closest_points/segment_to_segment.hpp | 6 +-- .../detail/closest_points/utilities.hpp | 4 +- .../detail/convex_hull/interface.hpp | 4 +- .../detail/covered_by/implementation.hpp | 2 +- .../detail/disjoint/linear_areal.hpp | 7 ++- .../detail/disjoint/linear_linear.hpp | 10 ++-- .../detail/disjoint/linear_segment_or_box.hpp | 2 +- .../detail/disjoint/multipoint_geometry.hpp | 18 +++---- .../detail/disjoint/segment_box.hpp | 7 ++- .../distance/geometry_to_segment_or_box.hpp | 20 +++---- .../detail/distance/linear_to_linear.hpp | 4 +- .../detail/distance/point_to_geometry.hpp | 4 +- .../detail/distance/segment_to_box.hpp | 25 +++++---- .../detail/distance/segment_to_segment.hpp | 4 +- .../detail/distance/strategy_utils.hpp | 8 +-- .../algorithms/detail/envelope/segment.hpp | 2 +- .../detail/equals/collect_vectors.hpp | 4 +- .../detail/has_self_intersections.hpp | 6 +-- .../algorithms/detail/intersection/multi.hpp | 3 +- .../is_simple/debug_print_boundary_points.hpp | 5 +- .../algorithms/detail/is_simple/linear.hpp | 21 ++++---- .../detail/is_simple/multipoint.hpp | 2 +- .../detail/is_valid/has_valid_self_turns.hpp | 6 +-- .../detail/is_valid/multipolygon.hpp | 6 +-- .../algorithms/detail/is_valid/polygon.hpp | 4 +- .../algorithms/detail/is_valid/segment.hpp | 2 +- .../detail/overlay/clip_linestring.hpp | 2 +- .../detail/overlay/copy_segment_point.hpp | 2 +- .../detail/overlay/copy_segments.hpp | 2 +- .../overlay/get_intersection_points.hpp | 4 +- .../detail/overlay/intersection_insert.hpp | 23 +++----- .../detail/relate/boundary_checker.hpp | 2 +- .../detail/relate/multi_point_geometry.hpp | 25 ++++----- .../detail/sections/sectionalize.hpp | 2 +- .../algorithms/detail/within/multi_point.hpp | 17 +++--- .../algorithms/discrete_frechet_distance.hpp | 4 +- .../discrete_hausdorff_distance.hpp | 54 +++++++++---------- .../boost/geometry/algorithms/for_each.hpp | 2 +- include/boost/geometry/algorithms/length.hpp | 3 +- .../geometry/algorithms/remove_spikes.hpp | 6 +-- .../boost/geometry/algorithms/simplify.hpp | 2 +- .../boost/geometry/algorithms/transform.hpp | 43 +++++++-------- .../geometries/concepts/box_concept.hpp | 7 ++- .../concepts/linestring_concept.hpp | 4 +- .../geometries/concepts/polygon_concept.hpp | 8 +-- .../geometries/concepts/ring_concept.hpp | 4 +- .../geometries/concepts/segment_concept.hpp | 6 +-- .../geometry/geometries/helper_geometry.hpp | 6 +-- .../index/detail/algorithms/bounds.hpp | 12 ++--- .../detail/algorithms/path_intersection.hpp | 7 ++- .../geometry/index/detail/bounded_view.hpp | 2 +- include/boost/geometry/io/dsv/write.hpp | 4 +- include/boost/geometry/io/wkt/read.hpp | 4 +- include/boost/geometry/io/wkt/write.hpp | 4 +- .../agnostic/point_in_box_by_side.hpp | 2 +- .../strategies/cartesian/centroid_average.hpp | 2 +- .../cartesian/centroid_bashein_detmer.hpp | 2 +- .../cartesian/centroid_weighted_length.hpp | 2 +- .../cartesian/disjoint_segment_box.hpp | 6 +-- .../cartesian/distance_pythagoras_box_box.hpp | 4 +- .../distance_pythagoras_point_box.hpp | 2 +- .../strategies/comparable_distance_result.hpp | 4 +- .../boost/geometry/strategies/disjoint.hpp | 4 +- .../geometry/strategies/distance_result.hpp | 4 +- .../distance_cross_track_box_box.hpp | 12 ++--- .../distance_cross_track_point_box.hpp | 6 +-- .../spherical/disjoint_segment_box.hpp | 4 +- .../distance_cross_track_box_box.hpp | 18 +++---- .../distance_cross_track_point_box.hpp | 12 ++--- include/boost/geometry/strategy/relate.hpp | 6 +-- .../spherical/envelope_multipoint.hpp | 4 +- .../strategy/spherical/envelope_point.hpp | 2 +- .../strategy/spherical/expand_point.hpp | 11 ++-- .../is_inverse_spheroidal_coordinates.hpp | 4 +- .../similarity/test_frechet_distance.hpp | 8 +-- .../robustness/common/make_square_polygon.hpp | 4 +- .../recursive_polygons_linear_areal.cpp | 4 +- 85 files changed, 285 insertions(+), 343 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp b/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp index 01812e3622..1e6b798cd3 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp @@ -86,8 +86,8 @@ inline void simplify_input(RangeIn const& range, template struct buffer_range { - typedef typename point_type::type output_point_type; - typedef typename coordinate_type::type coordinate_type; + using output_point_type = point_type_t; + using coordinate_type = coordinate_type_t; template < @@ -432,7 +432,7 @@ struct buffer_inserter { detail::buffer::buffer_point < - typename point_type::type + point_type_t >(point, collection, distance_strategy, point_strategy); } }; @@ -446,7 +446,7 @@ template > struct buffer_inserter_ring { - using output_point_type = typename point_type::type; + using output_point_type = point_type_t; template < @@ -609,8 +609,8 @@ template > struct buffer_inserter { - using output_ring_type = typename ring_type::type; - using output_point_type = typename point_type::type; + using output_ring_type = ring_type_t; + using output_point_type = point_type_t; template < diff --git a/include/boost/geometry/algorithms/detail/buffer/implementation.hpp b/include/boost/geometry/algorithms/detail/buffer/implementation.hpp index 76484726ff..a9608a440e 100644 --- a/include/boost/geometry/algorithms/detail/buffer/implementation.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/implementation.hpp @@ -78,15 +78,13 @@ struct buffer_all { typedef typename boost::range_value::type polygon_type; - typedef typename point_type::type point_type; - if (geometry::is_empty(geometry_in)) { // Then output geometry is kept empty as well return; } - model::box box; + model::box> box; geometry::envelope(geometry_in, box); geometry::buffer(box, box, distance_strategy.max_distance(join_strategy, end_strategy)); diff --git a/include/boost/geometry/algorithms/detail/closest_feature/geometry_to_range.hpp b/include/boost/geometry/algorithms/detail/closest_feature/geometry_to_range.hpp index c5d331aaf3..d5f53f2030 100644 --- a/include/boost/geometry/algorithms/detail/closest_feature/geometry_to_range.hpp +++ b/include/boost/geometry/algorithms/detail/closest_feature/geometry_to_range.hpp @@ -120,14 +120,8 @@ class geometry_to_range typename strategy::distance::services::return_type < Strategy, - typename point_type::type, - typename point_type - < - typename std::iterator_traits - < - RangeIterator - >::value_type - >::type + point_type_t, + point_type_t::value_type> >::type dist_min; return apply(geometry, first, last, strategy, dist_min); diff --git a/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp b/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp index be1729a86f..f26af3f264 100644 --- a/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp +++ b/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp @@ -177,14 +177,14 @@ class range_to_range_rtree typename strategy::distance::services::return_type < Strategy, - typename point_type::type, - typename point_type + point_type_t, + point_type_t < typename std::iterator_traits < QueryRangeIterator >::value_type - >::type + > >::type dist_min; return apply(rtree_first, rtree_last, queries_first, queries_last, diff --git a/include/boost/geometry/algorithms/detail/closest_points/linear_or_areal_to_areal.hpp b/include/boost/geometry/algorithms/detail/closest_points/linear_or_areal_to_areal.hpp index 6d643e1aca..d856927f37 100644 --- a/include/boost/geometry/algorithms/detail/closest_points/linear_or_areal_to_areal.hpp +++ b/include/boost/geometry/algorithms/detail/closest_points/linear_or_areal_to_areal.hpp @@ -39,8 +39,8 @@ struct linear_to_areal using point_type = typename std::conditional < std::is_same::type, most_precise_type>::value, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t >::type; using linestring_type = geometry::model::linestring; @@ -108,7 +108,7 @@ struct segment_to_areal Strategies const& strategies, bool = false) { - using linestring_type = geometry::model::linestring::type>; + using linestring_type = geometry::model::linestring>; linestring_type linestring; convert(segment, linestring); linear_to_areal::apply(linestring, areal, shortest_seg, strategies); @@ -142,8 +142,8 @@ struct areal_to_areal using point_type = typename std::conditional < std::is_same::type, most_precise_type>::value, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t >::type; using linestring_type = geometry::model::linestring; diff --git a/include/boost/geometry/algorithms/detail/closest_points/linear_to_linear.hpp b/include/boost/geometry/algorithms/detail/closest_points/linear_to_linear.hpp index d2927a6d39..2ad332ba07 100644 --- a/include/boost/geometry/algorithms/detail/closest_points/linear_to_linear.hpp +++ b/include/boost/geometry/algorithms/detail/closest_points/linear_to_linear.hpp @@ -43,7 +43,7 @@ struct linear_to_linear { dispatch::closest_points < - typename point_type::type, + point_type_t, Linear2 >::apply(*points_begin(linear1), linear2, shortest_seg, strategies); return; @@ -53,7 +53,7 @@ struct linear_to_linear { dispatch::closest_points < - typename point_type::type, + point_type_t, Linear1 >::apply(*points_begin(linear2), linear1, shortest_seg, strategies); detail::closest_points::swap_segment_points::apply(shortest_seg); @@ -91,7 +91,7 @@ struct segment_to_linear bool = false) { using linestring_type = geometry::model::linestring - ::type>; + >; linestring_type linestring; convert(segment, linestring); linear_to_linear::apply(linestring, linear, shortest_seg, strategies); diff --git a/include/boost/geometry/algorithms/detail/closest_points/multipoint_to_geometry.hpp b/include/boost/geometry/algorithms/detail/closest_points/multipoint_to_geometry.hpp index 2c0f22d5bd..3a38a33414 100644 --- a/include/boost/geometry/algorithms/detail/closest_points/multipoint_to_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/closest_points/multipoint_to_geometry.hpp @@ -125,7 +125,7 @@ struct segment_to_multipoint { using linestring_type = geometry::model::linestring < - typename point_type::type + point_type_t >; linestring_type linestring; convert(segment, linestring); @@ -150,7 +150,7 @@ struct multipoint_to_segment { using linestring_type = geometry::model::linestring < - typename point_type::type + point_type_t >; linestring_type linestring; convert(segment, linestring); diff --git a/include/boost/geometry/algorithms/detail/closest_points/point_to_geometry.hpp b/include/boost/geometry/algorithms/detail/closest_points/point_to_geometry.hpp index 5771858518..484fe683b7 100644 --- a/include/boost/geometry/algorithms/detail/closest_points/point_to_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/closest_points/point_to_geometry.hpp @@ -68,7 +68,7 @@ struct point_to_segment static inline void apply(Point const& point, Segment const& segment, OutputSegment& shortest_seg, Strategies const& strategies) { - typename point_type::type p[2]; + point_type_t p[2]; geometry::detail::assign_point_from_index<0>(segment, p[0]); geometry::detail::assign_point_from_index<1>(segment, p[1]); diff --git a/include/boost/geometry/algorithms/detail/closest_points/segment_to_segment.hpp b/include/boost/geometry/algorithms/detail/closest_points/segment_to_segment.hpp index 15d28cd690..7e5419e75b 100644 --- a/include/boost/geometry/algorithms/detail/closest_points/segment_to_segment.hpp +++ b/include/boost/geometry/algorithms/detail/closest_points/segment_to_segment.hpp @@ -54,7 +54,7 @@ class segment_to_segment { using intersection_return_type = segment_intersection_points < - typename point_type::type + point_type_t >; using intersection_policy = policies::relate::segments_intersection_points @@ -74,11 +74,11 @@ class segment_to_segment return; } - typename point_type::type p[2]; + point_type_t p[2]; detail::assign_point_from_index<0>(segment1, p[0]); detail::assign_point_from_index<1>(segment1, p[1]); - typename point_type::type q[2]; + point_type_t q[2]; detail::assign_point_from_index<0>(segment2, q[0]); detail::assign_point_from_index<1>(segment2, q[1]); diff --git a/include/boost/geometry/algorithms/detail/closest_points/utilities.hpp b/include/boost/geometry/algorithms/detail/closest_points/utilities.hpp index 858c86efb8..9aaa4dd809 100644 --- a/include/boost/geometry/algorithms/detail/closest_points/utilities.hpp +++ b/include/boost/geometry/algorithms/detail/closest_points/utilities.hpp @@ -57,8 +57,8 @@ using creturn_t = typename strategy::distance::services::return_type < distance_strategy_t >::type, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t >::type; diff --git a/include/boost/geometry/algorithms/detail/convex_hull/interface.hpp b/include/boost/geometry/algorithms/detail/convex_hull/interface.hpp index e141036141..ff8c1703b3 100644 --- a/include/boost/geometry/algorithms/detail/convex_hull/interface.hpp +++ b/include/boost/geometry/algorithms/detail/convex_hull/interface.hpp @@ -213,7 +213,7 @@ struct convex_hull detail::convex_hull::input_geometry_proxy in_proxy(geometry); detail::convex_hull::graham_andrew < - typename point_type::type + point_type_t >::apply(in_proxy, out, strategy); } }; @@ -234,7 +234,7 @@ struct convex_hull static bool const Reverse = geometry::point_order::value == counterclockwise; - std::array::type, 4> arr; + std::array, 4> arr; // TODO: This assigns only 2d cooridnates! // And it is also used in box_view<>! geometry::detail::assign_box_corners_oriented(box, arr); diff --git a/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp b/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp index 13626871aa..33ba1796a6 100644 --- a/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp +++ b/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp @@ -65,7 +65,7 @@ struct geometry_covered_by_box template static inline bool apply(Geometry const& geometry, Box const& box, Strategy const& strategy) { - using point_type = typename point_type::type; + using point_type = point_type_t; using mutable_point_type = typename helper_geometry::type; using box_type = model::box; diff --git a/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp b/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp index 7558284c60..b8648eb77b 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/linear_areal.hpp @@ -71,8 +71,7 @@ struct disjoint_no_intersections_policy template static inline bool apply(Geometry1 const& g1, Geometry2 const& g2, Strategy const& strategy) { - using point_type = typename point_type::type; - typename helper_geometry::type p; + typename helper_geometry>::type p; geometry::point_on_border(p, g1); return ! geometry::covered_by(p, g2, strategy); @@ -183,7 +182,7 @@ class disjoint_segment_areal return false; } - typename point_type::type p; + point_type_t p; detail::assign_point_from_index<0>(segment, p); return ! geometry::covered_by(p, polygon, strategy); @@ -219,7 +218,7 @@ struct disjoint_segment_areal return false; } - typename point_type::type p; + point_type_t p; detail::assign_point_from_index<0>(segment, p); return ! geometry::covered_by(p, ring, strategy); diff --git a/include/boost/geometry/algorithms/detail/disjoint/linear_linear.hpp b/include/boost/geometry/algorithms/detail/disjoint/linear_linear.hpp index a3e2f98433..dbe23010d0 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/linear_linear.hpp @@ -55,14 +55,12 @@ struct disjoint_segment static inline bool apply(Segment1 const& segment1, Segment2 const& segment2, Strategy const& strategy) { - typedef typename point_type::type point_type; - - typedef segment_intersection_points intersection_return_type; - - typedef policies::relate::segments_intersection_points + using point_type = point_type_t; + using intersection_return_type = segment_intersection_points; + using intersection_policy = policies::relate::segments_intersection_points < intersection_return_type - > intersection_policy; + >; detail::segment_as_subrange sub_range1(segment1); detail::segment_as_subrange sub_range2(segment2); diff --git a/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp b/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp index 1361811dab..25b91d3fe4 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/linear_segment_or_box.hpp @@ -86,7 +86,7 @@ struct disjoint_range_segment_or_box SegmentOrBox const& segment_or_box, Strategy const& strategy) { - using point_type = typename point_type::type; + using point_type = point_type_t; using range_segment = typename geometry::model::referring_segment; detail::closed_view const view(range); diff --git a/include/boost/geometry/algorithms/detail/disjoint/multipoint_geometry.hpp b/include/boost/geometry/algorithms/detail/disjoint/multipoint_geometry.hpp index 535c9006b5..8fa9f8a0c6 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/multipoint_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/multipoint_geometry.hpp @@ -254,7 +254,7 @@ class multipoint_linear // should be passed, where envelope would be lazily calculated when needed the first time geometry::partition < - geometry::model::box::type> + geometry::model::box> >::apply(multipoint, segment_range(linear), visitor, expand_box_point(strategy), overlaps_box_point(strategy), @@ -282,9 +282,9 @@ class multi_point_single_geometry SingleGeometry const& single_geometry, Strategy const& strategy) { - typedef typename point_type::type point1_type; - typedef typename point_type::type point2_type; - typedef model::box box2_type; + using point1_type = point_type_t; + using point2_type = point_type_t; + using box2_type = model::box; box2_type box2; geometry::envelope(single_geometry, box2, strategy); @@ -424,11 +424,11 @@ class multi_point_multi_geometry template static inline bool apply(MultiPoint const& multi_point, MultiGeometry const& multi_geometry, Strategy const& strategy) { - typedef typename point_type::type point1_type; - typedef typename point_type::type point2_type; - typedef model::box box1_type; - typedef model::box box2_type; - typedef std::pair box_pair_type; + using point1_type = point_type_t; + using point2_type = point_type_t; + using box1_type = model::box; + using box2_type = model::box; + using box_pair_type = std::pair; std::size_t count2 = boost::size(multi_geometry); std::vector boxes(count2); diff --git a/include/boost/geometry/algorithms/detail/disjoint/segment_box.hpp b/include/boost/geometry/algorithms/detail/disjoint/segment_box.hpp index 1f2d669e53..d959619c0b 100644 --- a/include/boost/geometry/algorithms/detail/disjoint/segment_box.hpp +++ b/include/boost/geometry/algorithms/detail/disjoint/segment_box.hpp @@ -84,8 +84,7 @@ struct disjoint_segment_box_sphere_or_spheroid DisjointPointBoxStrategy const& disjoint_point_box_strategy, DisjointBoxBoxStrategy const& disjoint_box_box_strategy) { - typedef typename point_type::type segment_point; - segment_point vertex; + point_type_t vertex; return apply(segment, box, vertex, azimuth_strategy, normalize_strategy, @@ -112,13 +111,13 @@ struct disjoint_segment_box_sphere_or_spheroid { assert_dimension_equal(); - typedef typename point_type::type segment_point_type; + using segment_point_type = point_type_t; segment_point_type p0, p1; geometry::detail::assign_point_from_index<0>(segment, p0); geometry::detail::assign_point_from_index<1>(segment, p1); - //vertex not computed here + // Vertex is not computed here disjoint_info disjoint_return_value = disjoint_info::disjoint_no_vertex; // Simplest cases first diff --git a/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp b/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp index 8d5d8b57cc..a012757170 100644 --- a/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp @@ -81,20 +81,16 @@ template class geometry_to_segment_or_box { private: - typedef typename point_type::type segment_or_box_point; - - typedef distance::strategy_t strategy_type; - - typedef detail::closest_feature::point_to_point_range + using segment_or_box_point = point_type_t; + using strategy_type = distance::strategy_t; + using point_to_point_range = detail::closest_feature::point_to_point_range < - typename point_type::type, + point_type_t, std::vector, segment_or_box_point_range_closure::value - > point_to_point_range; - - typedef detail::closest_feature::geometry_to_range geometry_to_range; - - typedef distance::creturn_t comparable_return_type; + >; + using geometry_to_range = detail::closest_feature::geometry_to_range; + using comparable_return_type = distance::creturn_t; // assign the new minimum value for an iterator of the point range // of a segment or a box @@ -320,7 +316,7 @@ class geometry_to_segment_or_box : dispatch::distance < - typename point_type::type, + point_type_t, SegmentOrBox, Strategies >::apply(*it_min, segment_or_box, strategies); diff --git a/include/boost/geometry/algorithms/detail/distance/linear_to_linear.hpp b/include/boost/geometry/algorithms/detail/distance/linear_to_linear.hpp index 0c3e68051b..194ae76bc6 100644 --- a/include/boost/geometry/algorithms/detail/distance/linear_to_linear.hpp +++ b/include/boost/geometry/algorithms/detail/distance/linear_to_linear.hpp @@ -47,7 +47,7 @@ struct linear_to_linear { return dispatch::distance < - typename point_type::type, + point_type_t, Linear2, Strategies >::apply(*points_begin(linear1), linear2, strategies); @@ -57,7 +57,7 @@ struct linear_to_linear { return dispatch::distance < - typename point_type::type, + point_type_t, Linear1, Strategies >::apply(*points_begin(linear2), linear1, strategies); diff --git a/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp b/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp index df28acef53..08c8f70597 100644 --- a/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp @@ -100,7 +100,7 @@ struct point_to_segment static inline auto apply(Point const& point, Segment const& segment, Strategies const& strategies) { - typename point_type::type p[2]; + point_type_t p[2]; geometry::detail::assign_point_from_index<0>(segment, p[0]); geometry::detail::assign_point_from_index<1>(segment, p[1]); @@ -117,7 +117,7 @@ struct point_to_segment static inline auto apply(Point const& point, Segment const& segment, Strategy const& strategy) { - typename point_type::type p[2]; + point_type_t p[2]; geometry::detail::assign_point_from_index<0>(segment, p[0]); geometry::detail::assign_point_from_index<1>(segment, p[1]); diff --git a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp index 547d0fdd6a..70fefae32a 100644 --- a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp @@ -82,17 +82,16 @@ template class segment_to_box_2D_generic { private: - typedef typename point_type::type segment_point; - typedef typename point_type::type box_point; + using segment_point = point_type_t; + using box_point = point_type_t; + using ps_strategy_type = distance::strategy_t; - typedef distance::strategy_t ps_strategy_type; - - typedef detail::closest_feature::point_to_point_range + using point_to_point_range = detail::closest_feature::point_to_point_range < segment_point, std::vector, open - > point_to_point_range; + >; public: // TODO: Or should the return type be defined by sb_strategy_type? @@ -187,15 +186,15 @@ template class segment_to_box_2D_generic // Use both PointSegment and PointBox strategies { private: - typedef typename point_type::type segment_point; - typedef typename point_type::type box_point; + using segment_point = point_type_t; + using box_point = point_type_t; - typedef distance::strategy_t ps_strategy_type; - typedef distance::strategy_t pb_strategy_type; + using ps_strategy_type = distance::strategy_t; + using pb_strategy_type = distance::strategy_t; public: // TODO: Or should the return type be defined by sb_strategy_type? - typedef distance::return_t return_type; + using return_type = distance::return_t; static inline return_type apply(Segment const& segment, Box const& box, @@ -732,8 +731,8 @@ class segment_to_box Box const& box, Strategies const& strategies) { - typedef typename point_type::type segment_point; - typedef typename point_type::type box_point; + using segment_point = point_type_t; + using box_point = point_type_t; segment_point p[2]; detail::assign_point_from_index<0>(segment, p[0]); diff --git a/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp b/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp index f308e58210..21933bdd6e 100644 --- a/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp +++ b/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp @@ -59,11 +59,11 @@ class segment_to_segment return 0; } - typename point_type::type p[2]; + point_type_t p[2]; detail::assign_point_from_index<0>(segment1, p[0]); detail::assign_point_from_index<1>(segment1, p[1]); - typename point_type::type q[2]; + point_type_t q[2]; detail::assign_point_from_index<0>(segment2, q[0]); detail::assign_point_from_index<1>(segment2, q[1]); diff --git a/include/boost/geometry/algorithms/detail/distance/strategy_utils.hpp b/include/boost/geometry/algorithms/detail/distance/strategy_utils.hpp index 8002846eb3..965cb91136 100644 --- a/include/boost/geometry/algorithms/detail/distance/strategy_utils.hpp +++ b/include/boost/geometry/algorithms/detail/distance/strategy_utils.hpp @@ -35,8 +35,8 @@ template using return_t = typename strategy::distance::services::return_type < strategy_t, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t >::type; @@ -51,8 +51,8 @@ template using creturn_t = typename strategy::distance::services::return_type < cstrategy_t, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t >::type; diff --git a/include/boost/geometry/algorithms/detail/envelope/segment.hpp b/include/boost/geometry/algorithms/detail/envelope/segment.hpp index 458e8488eb..7bfcfd9640 100644 --- a/include/boost/geometry/algorithms/detail/envelope/segment.hpp +++ b/include/boost/geometry/algorithms/detail/envelope/segment.hpp @@ -70,7 +70,7 @@ struct envelope_segment static inline void apply(Segment const& segment, Box& mbr, Strategy const& strategy) { - typename point_type::type p[2]; + point_type_t p[2]; detail::assign_point_from_index<0>(segment, p[0]); detail::assign_point_from_index<1>(segment, p[1]); diff --git a/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp b/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp index 7c70b30f82..952bf22154 100644 --- a/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp +++ b/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp @@ -344,7 +344,7 @@ struct box_collect_vectors static inline void apply(Collection& collection, Box const& box) { - typename point_type::type lower_left, lower_right, + point_type_t lower_left, lower_right, upper_left, upper_right; geometry::detail::assign_box_corners(box, lower_left, lower_right, upper_left, upper_right); @@ -365,7 +365,7 @@ struct box_collect_vectors { static inline void apply(Collection& collection, Box const& box) { - typename point_type::type lower_left, lower_right, + point_type_t lower_left, lower_right, upper_left, upper_right; geometry::detail::assign_box_corners(box, lower_left, lower_right, upper_left, upper_right); diff --git a/include/boost/geometry/algorithms/detail/has_self_intersections.hpp b/include/boost/geometry/algorithms/detail/has_self_intersections.hpp index faf21a98d0..61cb1dee99 100644 --- a/include/boost/geometry/algorithms/detail/has_self_intersections.hpp +++ b/include/boost/geometry/algorithms/detail/has_self_intersections.hpp @@ -70,12 +70,12 @@ inline bool has_self_intersections(Geometry const& geometry, Strategy const& strategy, bool throw_on_self_intersection = true) { - typedef typename point_type::type point_type; - typedef turn_info + using point_type = point_type_t; + using turn_info = turn_info < point_type, typename segment_ratio_type::type - > turn_info; + >; std::deque turns; detail::disjoint::disjoint_interrupt_policy policy; diff --git a/include/boost/geometry/algorithms/detail/intersection/multi.hpp b/include/boost/geometry/algorithms/detail/intersection/multi.hpp index 9c5d6721d0..7a90fd7b66 100644 --- a/include/boost/geometry/algorithms/detail/intersection/multi.hpp +++ b/include/boost/geometry/algorithms/detail/intersection/multi.hpp @@ -173,8 +173,7 @@ struct clip_multi_linestring Box const& box, OutputIterator out, Strategy const& ) { - typedef typename point_type::type point_type; - strategy::intersection::liang_barsky lb_strategy; + strategy::intersection::liang_barsky> lb_strategy; for (auto it = boost::begin(multi_linestring); it != boost::end(multi_linestring); ++it) { out = detail::intersection::clip_range_with_box diff --git a/include/boost/geometry/algorithms/detail/is_simple/debug_print_boundary_points.hpp b/include/boost/geometry/algorithms/detail/is_simple/debug_print_boundary_points.hpp index 7136e5167e..720f5b651b 100644 --- a/include/boost/geometry/algorithms/detail/is_simple/debug_print_boundary_points.hpp +++ b/include/boost/geometry/algorithms/detail/is_simple/debug_print_boundary_points.hpp @@ -65,10 +65,7 @@ struct debug_boundary_points_printer { static inline void apply(MultiLinestring const& multilinestring) { - typedef typename point_type::type point_type; - typedef std::vector point_vector; - - point_vector boundary_points; + std::vector> boundary_points; for (auto it = boost::begin(multilinestring); it != boost::end(multilinestring); ++it) { if ( boost::size(*it) > 1 diff --git a/include/boost/geometry/algorithms/detail/is_simple/linear.hpp b/include/boost/geometry/algorithms/detail/is_simple/linear.hpp index 33bb333861..8c91e0c9f7 100644 --- a/include/boost/geometry/algorithms/detail/is_simple/linear.hpp +++ b/include/boost/geometry/algorithms/detail/is_simple/linear.hpp @@ -187,22 +187,19 @@ class is_acceptable_turn template inline bool has_self_intersections(Linear const& linear, Strategy const& strategy) { - typedef typename point_type::type point_type; - - // compute self turns - typedef detail::overlay::turn_info turn_info; - - std::deque turns; - - typedef detail::overlay::get_turn_info + using point_type = point_type_t; + using turn_info = detail::overlay::turn_info; + using turn_policy = detail::overlay::get_turn_info < detail::disjoint::assign_disjoint_policy - > turn_policy; - - typedef is_acceptable_turn + >; + using is_acceptable_turn_type = is_acceptable_turn < Linear, Strategy - > is_acceptable_turn_type; + >; + + // Compute self turns + std::deque turns; is_acceptable_turn_type predicate(linear, strategy); detail::overlay::predicate_based_interrupt_policy diff --git a/include/boost/geometry/algorithms/detail/is_simple/multipoint.hpp b/include/boost/geometry/algorithms/detail/is_simple/multipoint.hpp index 2eba68f97e..25d513f823 100644 --- a/include/boost/geometry/algorithms/detail/is_simple/multipoint.hpp +++ b/include/boost/geometry/algorithms/detail/is_simple/multipoint.hpp @@ -47,7 +47,7 @@ struct is_simple_multipoint { typedef geometry::less < - typename point_type::type, + point_type_t, -1, Strategy > less_type; diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp index 9a6e921b34..9798694c63 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp @@ -44,14 +44,14 @@ template class has_valid_self_turns { private: - typedef typename point_type::type point_type; + using point_type = point_type_t; public: - typedef detail::overlay::turn_info + using turn_type = detail::overlay::turn_info < point_type, typename segment_ratio_type::type - > turn_type; + >; // returns true if all turns are valid template diff --git a/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp b/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp index 8b55ee85df..5bf5e7334d 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp @@ -103,8 +103,8 @@ class is_valid_multipolygon } } - typedef geometry::model::box::type> box_type; - typedef typename base::template partition_item item_type; + using box_type = geometry::model::box>; + using item_type = typename base::template partition_item; // put polygon iterators without turns in a vector std::vector polygon_iterators; @@ -123,7 +123,7 @@ class is_valid_multipolygon geometry::partition < - geometry::model::box::type> + geometry::model::box> >::apply(polygon_iterators, item_visitor, typename base::template expand_box(strategy), typename base::template overlaps_box(strategy)); diff --git a/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp b/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp index 006581aa3b..a02ce31932 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp @@ -305,8 +305,8 @@ class is_valid_polygon ring_indices.insert(tit->operations[1].seg_id.ring_index); } - typedef geometry::model::box::type> box_type; - typedef partition_item item_type; + using box_type = geometry::model::box>; + using item_type = partition_item; // put iterators for interior rings without turns in a vector std::vector ring_iterators; diff --git a/include/boost/geometry/algorithms/detail/is_valid/segment.hpp b/include/boost/geometry/algorithms/detail/is_valid/segment.hpp index b1d27dafd8..a2a6f061f8 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/segment.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/segment.hpp @@ -49,7 +49,7 @@ struct is_valid { boost::ignore_unused(visitor); - typename point_type::type p[2]; + point_type_t p[2]; detail::assign_point_from_index<0>(segment, p[0]); detail::assign_point_from_index<1>(segment, p[1]); diff --git a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp index 55f39a2f9e..e598dcfef1 100644 --- a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp @@ -191,7 +191,7 @@ OutputIterator clip_range_with_box(Box const& b, Range const& range, return out; } - typedef typename point_type::type point_type; + using point_type = point_type_t; OutputLinestring line_out; diff --git a/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp b/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp index 8280a25018..ad5d2f5cd9 100644 --- a/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp @@ -115,7 +115,7 @@ struct copy_segment_point_box SegmentIdentifier const& seg_id, signed_size_type offset, PointOut& point) { - std::array::type, 4> bp; + std::array, 4> bp; assign_box_corners_oriented(box, bp); signed_size_type const target = circular_offset(4, seg_id.segment_index, offset); diff --git a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp index d08683b831..f6a70648a9 100644 --- a/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/copy_segments.hpp @@ -225,7 +225,7 @@ struct copy_segments_box : 5 - index + to_index + 1; // Create array of points, the fifth one closes it - std::array::type, 5> bp; + std::array, 5> bp; assign_box_corners_oriented(box, bp); bp[4] = bp[0]; diff --git a/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp b/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp index 7afe853012..9085387c1f 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp @@ -98,8 +98,8 @@ inline void get_intersection_points(Geometry1 const& geometry1, typedef detail::get_intersection_points::get_turn_without_info < - typename point_type::type, - typename point_type::type, + point_type_t, + point_type_t, typename boost::range_value::type > TurnPolicy; diff --git a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp index 6d4b857fb7..1dbd717ae5 100644 --- a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp @@ -79,16 +79,14 @@ struct intersection_segment_segment_point OutputIterator out, Strategy const& strategy) { - typedef typename point_type::type point_type; - - // Get the intersection point (or two points) - typedef segment_intersection_points intersection_return_type; - - typedef policies::relate::segments_intersection_points + using point_type = point_type_t; + using intersection_return_type = segment_intersection_points; + using policy_type = policies::relate::segments_intersection_points < intersection_return_type - > policy_type; + >; + // Get the intersection point (or two points) detail::segment_as_subrange sub_range1(segment1); detail::segment_as_subrange sub_range2(segment2); @@ -286,10 +284,7 @@ struct intersection_of_linestring_with_areal GeometryOut, linestring_tag, linestring_tag > linear; - typedef typename point_type - < - typename linear::type - >::type point_type; + using point_type = point_type_t; typedef geometry::segment_ratio < @@ -632,8 +627,7 @@ struct intersection_insert Box const& box, OutputIterator out, Strategy const& ) { - typedef typename point_type::type point_type; - strategy::intersection::liang_barsky lb_strategy; + strategy::intersection::liang_barsky> lb_strategy; return detail::intersection::clip_range_with_box (box, linestring, out, lb_strategy); } @@ -713,8 +707,7 @@ struct intersection_insert { geometry::segment_view range(segment); - typedef typename point_type::type point_type; - strategy::intersection::liang_barsky lb_strategy; + strategy::intersection::liang_barsky> lb_strategy; return detail::intersection::clip_range_with_box (box, range, out, lb_strategy); } diff --git a/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp b/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp index 91f4dac5b0..d513ec319a 100644 --- a/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp +++ b/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp @@ -150,7 +150,7 @@ inline void copy_boundary_points_of_mls(MultiLinestring const& mls, Strategy con template class boundary_checker { - using point_type = typename point_type::type; + using point_type = point_type_t; using mutable_point_type = typename helper_geometry::type; public: diff --git a/include/boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp b/include/boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp index 204a4fe22d..8d6fe39a56 100644 --- a/include/boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/relate/multi_point_geometry.hpp @@ -182,8 +182,7 @@ struct multi_point_single_geometry Result & result, Strategy const& strategy) { - typedef typename point_type::type point2_type; - typedef model::box box2_type; + using box2_type = model::box> ; box2_type box2; geometry::envelope(single_geometry, box2, strategy); @@ -402,11 +401,9 @@ class multi_point_multi_geometry_ii_ib }; public: - typedef typename point_type::type point1_type; - typedef typename point_type::type point2_type; - typedef model::box box1_type; - typedef model::box box2_type; - typedef std::pair box_pair_type; + using box1_type = model::box>; + using box2_type = model::box>; + using box_pair_type = std::pair; template static inline void apply(MultiPoint const& multi_point, @@ -439,12 +436,10 @@ class multi_point_multi_geometry_ii_ib template struct multi_point_multi_geometry_ii_ib_ie { - typedef typename point_type::type point1_type; - typedef typename point_type::type point2_type; - typedef model::box box1_type; - typedef model::box box2_type; - typedef std::pair box_pair_type; - typedef std::vector boxes_type; + using box1_type = model::box>; + using box2_type = model::box>; + using box_pair_type = std::pair; + using boxes_type = std::vector; template static inline void apply(MultiPoint const& multi_point, @@ -532,9 +527,7 @@ struct multi_point_multi_geometry Result & result, Strategy const& strategy) { - typedef typename point_type::type point2_type; - typedef model::box box2_type; - typedef std::pair box_pair_type; + using box_pair_type = std::pair>, std::size_t>; std::size_t count2 = boost::size(multi_geometry); std::vector boxes(count2); diff --git a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp index 7b36ec4778..872f54668f 100644 --- a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp +++ b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp @@ -634,7 +634,7 @@ struct sectionalize_box Strategy const& strategy, ring_identifier const& ring_id, std::size_t max_count) { - using point_type = typename point_type::type; + using point_type = point_type_t; assert_dimension(); diff --git a/include/boost/geometry/algorithms/detail/within/multi_point.hpp b/include/boost/geometry/algorithms/detail/within/multi_point.hpp index 42e121b42c..8ba07e0917 100644 --- a/include/boost/geometry/algorithms/detail/within/multi_point.hpp +++ b/include/boost/geometry/algorithms/detail/within/multi_point.hpp @@ -122,12 +122,8 @@ struct multi_point_single_geometry LinearOrAreal const& linear_or_areal, Strategy const& strategy) { - //typedef typename boost::range_value::type point1_type; - typedef typename point_type::type point2_type; - typedef model::box box2_type; - // Create envelope of geometry - box2_type box; + model::box> box; geometry::envelope(linear_or_areal, box, strategy); geometry::detail::expand_by_epsilon(box); @@ -170,16 +166,17 @@ struct multi_point_multi_geometry LinearOrAreal const& linear_or_areal, Strategy const& strategy) { - typedef typename point_type::type point2_type; - typedef model::box box2_type; + using point2_type = point_type_t; + using box2_type = model::box; + using box_pair_type = std::pair; + using box_pair_vector = std::vector; + static const bool is_linear = util::is_linear::value; // TODO: box pairs could be constructed on the fly, inside the rtree // Prepare range of envelopes and ids std::size_t count2 = boost::size(linear_or_areal); - typedef std::pair box_pair_type; - typedef std::vector box_pair_vector; box_pair_vector boxes(count2); for (std::size_t i = 0 ; i < count2 ; ++i) { @@ -245,7 +242,7 @@ struct multi_point_multi_geometry } else { - found_boundary = true; + found_boundary = true; } } else diff --git a/include/boost/geometry/algorithms/discrete_frechet_distance.hpp b/include/boost/geometry/algorithms/discrete_frechet_distance.hpp index 2b962d8d98..aff3515503 100644 --- a/include/boost/geometry/algorithms/discrete_frechet_distance.hpp +++ b/include/boost/geometry/algorithms/discrete_frechet_distance.hpp @@ -76,8 +76,8 @@ struct linestring_linestring { typedef typename distance_result < - typename point_type::type, - typename point_type::type, + point_type_t, + point_type_t, Strategies >::type result_type; typedef typename boost::range_size::type size_type1; diff --git a/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp b/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp index b2f787579c..88c5bb3a05 100644 --- a/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp +++ b/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp @@ -59,29 +59,29 @@ namespace detail { namespace discrete_hausdorff_distance struct point_range { template - static inline auto apply(Point const& pnt, Range const& rng, + static inline auto apply(Point const& pnt, Range const& range, Strategies const& strategies) { typedef typename distance_result < Point, - typename point_type::type, + point_type_t, Strategies >::type result_type; typedef typename boost::range_size::type size_type; - boost::geometry::detail::throw_on_empty_input(rng); + boost::geometry::detail::throw_on_empty_input(range); auto const strategy = strategies.distance(dummy_point(), dummy_point()); - size_type const n = boost::size(rng); + size_type const n = boost::size(range); result_type dis_min = 0; bool is_dis_min_set = false; for (size_type i = 0 ; i < n ; i++) { - result_type dis_temp = strategy.apply(pnt, range::at(rng, i)); + result_type dis_temp = strategy.apply(pnt, range::at(range, i)); if (! is_dis_min_set || dis_temp < dis_min) { dis_min = dis_temp; @@ -100,8 +100,8 @@ struct range_range { typedef typename distance_result < - typename point_type::type, - typename point_type::type, + point_type_t, + point_type_t, Strategies >::type result_type; @@ -115,8 +115,8 @@ struct range_range #ifdef BOOST_GEOMETRY_ENABLE_SIMILARITY_RTREE namespace bgi = boost::geometry::index; - typedef typename point_type::type point_t; - typedef bgi::rtree > rtree_type; + using point_t = point_type_t; + using rtree_type = bgi::rtree >; rtree_type rtree(boost::begin(r2), boost::end(r2)); point_t res; #endif @@ -141,27 +141,27 @@ struct range_range struct range_multi_range { - template - static inline auto apply(Range const& rng, Multi_range const& mrng, + template + static inline auto apply(Range const& range, MultiRange const& multi_range, Strategies const& strategies) { typedef typename distance_result < - typename point_type::type, - typename point_type::type, + point_type_t, + point_type_t, Strategies >::type result_type; - typedef typename boost::range_size::type size_type; + typedef typename boost::range_size::type size_type; - boost::geometry::detail::throw_on_empty_input(rng); - boost::geometry::detail::throw_on_empty_input(mrng); + boost::geometry::detail::throw_on_empty_input(range); + boost::geometry::detail::throw_on_empty_input(multi_range); - size_type b = boost::size(mrng); + size_type b = boost::size(multi_range); result_type haus_dis = 0; for (size_type j = 0 ; j < b ; j++) { - result_type dis_max = range_range::apply(rng, range::at(mrng, j), strategies); + result_type dis_max = range_range::apply(range, range::at(multi_range, j), strategies); if (dis_max > haus_dis) { haus_dis = dis_max; @@ -175,27 +175,27 @@ struct range_multi_range struct multi_range_multi_range { - template - static inline auto apply(Multi_Range1 const& mrng1, Multi_range2 const& mrng2, + template + static inline auto apply(MultiRange1 const& multi_range1, MultiRange2 const& multi_range2, Strategies const& strategies) { typedef typename distance_result < - typename point_type::type, - typename point_type::type, + point_type_t, + point_type_t, Strategies >::type result_type; - typedef typename boost::range_size::type size_type; + typedef typename boost::range_size::type size_type; - boost::geometry::detail::throw_on_empty_input(mrng1); - boost::geometry::detail::throw_on_empty_input(mrng2); + boost::geometry::detail::throw_on_empty_input(multi_range1); + boost::geometry::detail::throw_on_empty_input(multi_range2); - size_type n = boost::size(mrng1); + size_type n = boost::size(multi_range1); result_type haus_dis = 0; for (size_type i = 0 ; i < n ; i++) { - result_type dis_max = range_multi_range::apply(range::at(mrng1, i), mrng2, strategies); + result_type dis_max = range_multi_range::apply(range::at(multi_range1, i), multi_range2, strategies); if (dis_max > haus_dis) { haus_dis = dis_max; diff --git a/include/boost/geometry/algorithms/for_each.hpp b/include/boost/geometry/algorithms/for_each.hpp index 56636e31a9..a1fd0a6cc2 100644 --- a/include/boost/geometry/algorithms/for_each.hpp +++ b/include/boost/geometry/algorithms/for_each.hpp @@ -117,7 +117,7 @@ struct fe_point_type typedef util::transcribe_const_t < Range, - typename point_type::type + point_type_t > type; }; diff --git a/include/boost/geometry/algorithms/length.hpp b/include/boost/geometry/algorithms/length.hpp index 6e4533896a..a79e78dd74 100644 --- a/include/boost/geometry/algorithms/length.hpp +++ b/include/boost/geometry/algorithms/length.hpp @@ -64,8 +64,7 @@ struct segment_length static inline typename default_length_result::type apply(Segment const& segment, Strategies const& strategies) { - typedef typename point_type::type point_type; - point_type p1, p2; + point_type_t p1, p2; geometry::detail::assign_point_from_index<0>(segment, p1); geometry::detail::assign_point_from_index<1>(segment, p2); return strategies.distance(p1, p2).apply(p1, p2); diff --git a/include/boost/geometry/algorithms/remove_spikes.hpp b/include/boost/geometry/algorithms/remove_spikes.hpp index 889fc300b4..48880a5033 100644 --- a/include/boost/geometry/algorithms/remove_spikes.hpp +++ b/include/boost/geometry/algorithms/remove_spikes.hpp @@ -68,9 +68,7 @@ struct range_remove_spikes template static inline void apply(Range& range, SideStrategy const& strategy) { - typedef typename point_type::type point_type; - - std::size_t n = boost::size(range); + std::size_t const n = boost::size(range); std::size_t const min_num_points = core_detail::closure::minimum_ring_size < geometry::closure::value @@ -80,7 +78,7 @@ struct range_remove_spikes return; } - std::vector cleaned; + std::vector> cleaned; cleaned.reserve(n); for (auto const& p : range) diff --git a/include/boost/geometry/algorithms/simplify.hpp b/include/boost/geometry/algorithms/simplify.hpp index 345f0deaf2..28a3a5582c 100644 --- a/include/boost/geometry/algorithms/simplify.hpp +++ b/include/boost/geometry/algorithms/simplify.hpp @@ -1078,7 +1078,7 @@ inline void simplify_insert(Geometry const& geometry, OutputIterator out, { // Concept: output point type = point type of input geometry concepts::check(); - concepts::check::type>(); + concepts::check>(); simplify_insert(geometry, out, max_distance, default_strategy()); } diff --git a/include/boost/geometry/algorithms/transform.hpp b/include/boost/geometry/algorithms/transform.hpp index 4ce767cbc2..8b7e814ec8 100644 --- a/include/boost/geometry/algorithms/transform.hpp +++ b/include/boost/geometry/algorithms/transform.hpp @@ -70,8 +70,8 @@ struct transform_box static inline bool apply(Box1 const& b1, Box2& b2, Strategy const& strategy) { - typedef typename point_type::type point_type1; - typedef typename point_type::type point_type2; + using point_type1 = point_type_t; + using point_type2 = point_type_t; point_type1 lower_left, upper_right; geometry::detail::assign::assign_box_2d_corner( @@ -83,7 +83,7 @@ struct transform_box if (strategy.apply(lower_left, p1) && strategy.apply(upper_right, p2)) { // Create a valid box and therefore swap if necessary - typedef typename coordinate_type::type coordinate_type; + using coordinate_type = coordinate_type_t; coordinate_type x1 = geometry::get<0>(p1) , y1 = geometry::get<1>(p1) , x2 = geometry::get<0>(p2) @@ -109,14 +109,11 @@ struct transform_box_or_segment static inline bool apply(Geometry1 const& source, Geometry2& target, Strategy const& strategy) { - typedef typename point_type::type point_type1; - typedef typename point_type::type point_type2; - - point_type1 source_point[2]; + point_type_t source_point[2]; geometry::detail::assign_point_from_index<0>(source, source_point[0]); geometry::detail::assign_point_from_index<1>(source, source_point[1]); - point_type2 target_point[2]; + point_type_t target_point[2]; if (strategy.apply(source_point[0], target_point[0]) && strategy.apply(source_point[1], target_point[1])) { @@ -158,7 +155,7 @@ struct transform_polygon static inline bool apply(Polygon1 const& poly1, Polygon2& poly2, Strategy const& strategy) { - typedef typename point_type::type point2_type; + using point2_type = point_type_t; geometry::clear(poly2); @@ -198,20 +195,20 @@ struct transform_polygon }; -template +template struct select_strategy { - typedef typename strategy::transform::services::default_strategy + using type = typename strategy::transform::services::default_strategy < - cs_tag_t, - cs_tag_t, - typename coordinate_system::type, - typename coordinate_system::type, - dimension::type::value, - dimension::type::value, - typename point_type::type, - typename point_type::type - >::type type; + cs_tag_t, + cs_tag_t, + coordinate_system_t, + coordinate_system_t, + dimension::value, + dimension::value, + point_type_t, + point_type_t + >::type; }; struct transform_range @@ -220,11 +217,9 @@ struct transform_range static inline bool apply(Range1 const& range1, Range2& range2, Strategy const& strategy) { - typedef typename point_type::type point_type; - - // Should NOT be done here! + // "clear" should NOT be done here! // geometry::clear(range2); - return transform_range_out(range1, + return transform_range_out>(range1, range::back_inserter(range2), strategy); } }; diff --git a/include/boost/geometry/geometries/concepts/box_concept.hpp b/include/boost/geometry/geometries/concepts/box_concept.hpp index c96d39f6a4..491446a22b 100644 --- a/include/boost/geometry/geometries/concepts/box_concept.hpp +++ b/include/boost/geometry/geometries/concepts/box_concept.hpp @@ -34,8 +34,7 @@ template class Box { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename point_type::type point_type; - + using point_type = point_type_t; template < @@ -80,8 +79,8 @@ template class ConstBox { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename point_type::type point_type; - typedef typename coordinate_type::type coordinate_type; + using point_type = point_type_t; + using coordinate_type = coordinate_type_t; template < diff --git a/include/boost/geometry/geometries/concepts/linestring_concept.hpp b/include/boost/geometry/geometries/concepts/linestring_concept.hpp index 49dc8b221b..7a322aa531 100644 --- a/include/boost/geometry/geometries/concepts/linestring_concept.hpp +++ b/include/boost/geometry/geometries/concepts/linestring_concept.hpp @@ -39,7 +39,7 @@ template class Linestring { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename point_type::type point_type; + using point_type = point_type_t; BOOST_CONCEPT_ASSERT( (concepts::Point) ); BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept) ); @@ -68,7 +68,7 @@ template class ConstLinestring { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename point_type::type point_type; + using point_type = point_type_t; BOOST_CONCEPT_ASSERT( (concepts::ConstPoint) ); //BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept) ); diff --git a/include/boost/geometry/geometries/concepts/polygon_concept.hpp b/include/boost/geometry/geometries/concepts/polygon_concept.hpp index 7488ab3dee..17eeae89ac 100644 --- a/include/boost/geometry/geometries/concepts/polygon_concept.hpp +++ b/include/boost/geometry/geometries/concepts/polygon_concept.hpp @@ -53,8 +53,8 @@ class Polygon typedef typename traits::interior_const_type::type interior_const_type; typedef typename traits::interior_mutable_type::type interior_mutable_type; - typedef typename point_type::type point_type; - typedef typename ring_type::type ring_type; + using point_type = point_type_t; + using ring_type = ring_type_t; BOOST_CONCEPT_ASSERT( (concepts::Point) ); BOOST_CONCEPT_ASSERT( (concepts::Ring) ); @@ -102,8 +102,8 @@ class ConstPolygon typedef typename traits::ring_const_type::type ring_const_type; typedef typename traits::interior_const_type::type interior_const_type; - typedef typename point_type::type point_type; - typedef typename ring_type::type ring_type; + using point_type = point_type_t; + using ring_type = ring_type_t; BOOST_CONCEPT_ASSERT( (concepts::ConstPoint) ); BOOST_CONCEPT_ASSERT( (concepts::ConstRing) ); diff --git a/include/boost/geometry/geometries/concepts/ring_concept.hpp b/include/boost/geometry/geometries/concepts/ring_concept.hpp index b4cf961adb..ba2cc4ea6b 100644 --- a/include/boost/geometry/geometries/concepts/ring_concept.hpp +++ b/include/boost/geometry/geometries/concepts/ring_concept.hpp @@ -38,7 +38,7 @@ template class Ring { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename point_type::type point_type; + using point_type = point_type_t; BOOST_CONCEPT_ASSERT( (concepts::Point) ); BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept) ); @@ -67,7 +67,7 @@ template class ConstRing { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename point_type::type point_type; + using point_type = point_type_t; BOOST_CONCEPT_ASSERT( (concepts::ConstPoint) ); BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept) ); diff --git a/include/boost/geometry/geometries/concepts/segment_concept.hpp b/include/boost/geometry/geometries/concepts/segment_concept.hpp index 7dac9e3ed7..c2bc332fd5 100644 --- a/include/boost/geometry/geometries/concepts/segment_concept.hpp +++ b/include/boost/geometry/geometries/concepts/segment_concept.hpp @@ -36,7 +36,7 @@ template class Segment { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename point_type::type point_type; + using point_type = point_type_t; BOOST_CONCEPT_ASSERT( (concepts::Point) ); @@ -80,8 +80,8 @@ template class ConstSegment { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename point_type::type point_type; - typedef typename coordinate_type::type coordinate_type; + using point_type = point_type_t; + using coordinate_type = coordinate_type_t; BOOST_CONCEPT_ASSERT( (concepts::ConstPoint) ); diff --git a/include/boost/geometry/geometries/helper_geometry.hpp b/include/boost/geometry/geometries/helper_geometry.hpp index ee8c2e56b1..6cade9723c 100644 --- a/include/boost/geometry/geometries/helper_geometry.hpp +++ b/include/boost/geometry/geometries/helper_geometry.hpp @@ -87,7 +87,7 @@ struct helper_geometry < typename helper_geometry < - typename point_type::type, NewCoordinateType, NewUnits + point_type_t, NewCoordinateType, NewUnits >::type >; }; @@ -100,7 +100,7 @@ struct helper_geometry < typename helper_geometry < - typename point_type::type, NewCoordinateType, NewUnits + point_type_t, NewCoordinateType, NewUnits >::type >; }; @@ -112,7 +112,7 @@ struct helper_geometry < typename helper_geometry < - typename point_type::type, NewCoordinateType, NewUnits + point_type_t, NewCoordinateType, NewUnits >::type, point_order::value != counterclockwise, closure::value != open diff --git a/include/boost/geometry/index/detail/algorithms/bounds.hpp b/include/boost/geometry/index/detail/algorithms/bounds.hpp index 999246d9c9..6165044580 100644 --- a/include/boost/geometry/index/detail/algorithms/bounds.hpp +++ b/include/boost/geometry/index/detail/algorithms/bounds.hpp @@ -186,9 +186,9 @@ struct covered_by_bounds { static inline bool apply(Geometry const& g, Bounds & b) { - typedef typename point_type::type point_type; - typedef geometry::model::box bounds_type; - typedef index::detail::bounded_view view_type; + using point_type = point_type_t; + using bounds_type = geometry::model::box; + using view_type = index::detail::bounded_view; return geometry::covered_by(view_type(g, default_strategy()), b); } @@ -196,9 +196,9 @@ struct covered_by_bounds template static inline bool apply(Geometry const& g, Bounds & b, Strategy const& strategy) { - typedef typename point_type::type point_type; - typedef geometry::model::box bounds_type; - typedef index::detail::bounded_view view_type; + using point_type = point_type_t; + using bounds_type = geometry::model::box; + using view_type = index::detail::bounded_view; return geometry::covered_by(view_type(g, strategy), b, strategy); } diff --git a/include/boost/geometry/index/detail/algorithms/path_intersection.hpp b/include/boost/geometry/index/detail/algorithms/path_intersection.hpp index afa203e1e3..5cf936694c 100644 --- a/include/boost/geometry/index/detail/algorithms/path_intersection.hpp +++ b/include/boost/geometry/index/detail/algorithms/path_intersection.hpp @@ -52,12 +52,11 @@ struct path_intersection template struct path_intersection { - typedef typename default_distance_result::type>::type comparable_distance_type; + using comparable_distance_type = typename default_distance_result>::type; static inline bool apply(Indexable const& b, Segment const& segment, comparable_distance_type & comparable_distance) { - typedef typename point_type::type point_type; - point_type p1, p2; + point_type_t p1, p2; geometry::detail::assign_point_from_index<0>(segment, p1); geometry::detail::assign_point_from_index<1>(segment, p2); return index::detail::segment_intersection(b, p1, p2, comparable_distance); @@ -67,7 +66,7 @@ struct path_intersection template struct path_intersection { - typedef typename default_length_result::type comparable_distance_type; + using comparable_distance_type = typename default_length_result::type; static inline bool apply(Indexable const& b, Linestring const& path, comparable_distance_type & comparable_distance) { diff --git a/include/boost/geometry/index/detail/bounded_view.hpp b/include/boost/geometry/index/detail/bounded_view.hpp index b3776416b0..1ba9f37f5a 100644 --- a/include/boost/geometry/index/detail/bounded_view.hpp +++ b/include/boost/geometry/index/detail/bounded_view.hpp @@ -241,7 +241,7 @@ struct tag< index::detail::bounded_view > template struct point_type< index::detail::bounded_view > { - typedef typename point_type::type type; + using type = point_type_t; }; template diff --git a/include/boost/geometry/io/dsv/write.hpp b/include/boost/geometry/io/dsv/write.hpp index 39a046016e..e73cdfb810 100644 --- a/include/boost/geometry/io/dsv/write.hpp +++ b/include/boost/geometry/io/dsv/write.hpp @@ -226,7 +226,7 @@ struct dsv_poly template struct dsv_per_index { - typedef typename point_type::type point_type; + using type = point_type_t; template static inline void apply(std::basic_ostream& os, @@ -245,7 +245,7 @@ struct dsv_per_index template struct dsv_indexed { - typedef typename point_type::type point_type; + using type = point_type_t; template static inline void apply(std::basic_ostream& os, diff --git a/include/boost/geometry/io/wkt/read.hpp b/include/boost/geometry/io/wkt/read.hpp index c0f1cdcd63..1cc294ac27 100644 --- a/include/boost/geometry/io/wkt/read.hpp +++ b/include/boost/geometry/io/wkt/read.hpp @@ -786,7 +786,7 @@ struct box_parser BOOST_THROW_EXCEPTION(read_wkt_exception("Should start with 'POLYGON' or 'BOX'", wkt)); } - using point_type = typename point_type::type; + using point_type = point_type_t; std::vector points; container_inserter::apply(it, end, wkt, std::back_inserter(points)); @@ -855,7 +855,7 @@ struct segment_parser BOOST_THROW_EXCEPTION(read_wkt_exception("Should start with 'LINESTRING' or 'SEGMENT'", wkt)); } - using point_type = typename point_type::type; + using point_type = point_type_t; std::vector points; container_inserter::apply(it, end, wkt, std::back_inserter(points)); diff --git a/include/boost/geometry/io/wkt/write.hpp b/include/boost/geometry/io/wkt/write.hpp index f268a4f443..4b776e02d9 100644 --- a/include/boost/geometry/io/wkt/write.hpp +++ b/include/boost/geometry/io/wkt/write.hpp @@ -254,7 +254,7 @@ struct wkt_multi template struct wkt_box { - using point_type = typename point_type::type; + using point_type = point_type_t; template static inline void apply(std::basic_ostream& os, @@ -298,7 +298,7 @@ struct wkt_box template struct wkt_segment { - using point_type = typename point_type::type; + using point_type = point_type_t; template static inline void apply(std::basic_ostream& os, diff --git a/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp b/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp index 6199634823..0cfb0425cb 100644 --- a/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp +++ b/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp @@ -85,7 +85,7 @@ inline bool point_in_box_by_side(Point const& point, Box const& box, // Create (counterclockwise) array of points, the fifth one closes it // Every point should be on the LEFT side (=1), or ON the border (=0), // So >= 1 or >= 0 - std::array::type, 5> bp; + std::array, 5> bp; geometry::detail::assign_box_corners_oriented(box, bp); bp[4] = bp[0]; diff --git a/include/boost/geometry/strategies/cartesian/centroid_average.hpp b/include/boost/geometry/strategies/cartesian/centroid_average.hpp index a382a2fbd4..5b642a7f49 100644 --- a/include/boost/geometry/strategies/cartesian/centroid_average.hpp +++ b/include/boost/geometry/strategies/cartesian/centroid_average.hpp @@ -118,7 +118,7 @@ struct default_strategy typedef average < Point, - typename point_type::type + point_type_t > type; }; diff --git a/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp b/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp index 1c5bf1fd75..8e4c014a48 100644 --- a/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp +++ b/include/boost/geometry/strategies/cartesian/centroid_bashein_detmer.hpp @@ -247,7 +247,7 @@ struct default_strategy typedef bashein_detmer < Point, - typename point_type::type + point_type_t > type; }; diff --git a/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp b/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp index 3bf16a4c00..6e8595881a 100644 --- a/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp +++ b/include/boost/geometry/strategies/cartesian/centroid_weighted_length.hpp @@ -165,7 +165,7 @@ struct default_strategy typedef weighted_length < Point, - typename point_type::type + point_type_t > type; }; diff --git a/include/boost/geometry/strategies/cartesian/disjoint_segment_box.hpp b/include/boost/geometry/strategies/cartesian/disjoint_segment_box.hpp index ee041d2542..39ebe395c3 100644 --- a/include/boost/geometry/strategies/cartesian/disjoint_segment_box.hpp +++ b/include/boost/geometry/strategies/cartesian/disjoint_segment_box.hpp @@ -257,12 +257,12 @@ struct segment_box { assert_dimension_equal(); - typedef typename util::calculation_type::geometric::binary + using relative_distance_type = typename util::calculation_type::geometric::binary < Segment, Box, void - >::type relative_distance_type; + >::type; - typedef typename point_type::type segment_point_type; + using segment_point_type = point_type_t; segment_point_type p0, p1; geometry::detail::assign_point_from_index<0>(segment, p0); geometry::detail::assign_point_from_index<1>(segment, p1); diff --git a/include/boost/geometry/strategies/cartesian/distance_pythagoras_box_box.hpp b/include/boost/geometry/strategies/cartesian/distance_pythagoras_box_box.hpp index 61545fa2a9..ea8f8d6b0a 100644 --- a/include/boost/geometry/strategies/cartesian/distance_pythagoras_box_box.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_pythagoras_box_box.hpp @@ -118,9 +118,9 @@ public : apply(Box1 const& box1, Box2 const& box2) { BOOST_CONCEPT_ASSERT - ( (concepts::ConstPoint::type>) ); + ( (concepts::ConstPoint>) ); BOOST_CONCEPT_ASSERT - ( (concepts::ConstPoint::type>) ); + ( (concepts::ConstPoint>) ); // Calculate distance using Pythagoras // (Leave comment above for Doxygen) diff --git a/include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp b/include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp index c9115a6cbb..9d1b0949fa 100644 --- a/include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_pythagoras_point_box.hpp @@ -115,7 +115,7 @@ public : { BOOST_CONCEPT_ASSERT( (concepts::ConstPoint) ); BOOST_CONCEPT_ASSERT - ( (concepts::ConstPoint::type>) ); + ( (concepts::ConstPoint>) ); // Calculate distance using Pythagoras // (Leave comment above for Doxygen) diff --git a/include/boost/geometry/strategies/comparable_distance_result.hpp b/include/boost/geometry/strategies/comparable_distance_result.hpp index 42a6b211a5..46c9550c29 100644 --- a/include/boost/geometry/strategies/comparable_distance_result.hpp +++ b/include/boost/geometry/strategies/comparable_distance_result.hpp @@ -78,8 +78,8 @@ struct comparable_distance_result : strategy::distance::services::return_type < typename comparable_distance_strategy_type::type, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t > {}; diff --git a/include/boost/geometry/strategies/disjoint.hpp b/include/boost/geometry/strategies/disjoint.hpp index 3e24e6b6a4..06869a513b 100644 --- a/include/boost/geometry/strategies/disjoint.hpp +++ b/include/boost/geometry/strategies/disjoint.hpp @@ -61,7 +61,7 @@ template struct default_strategy : strategy::covered_by::services::default_strategy < - typename point_type::type, + point_type_t, Box > {}; @@ -70,7 +70,7 @@ template struct default_strategy : strategy::covered_by::services::default_strategy < - typename point_type::type, + point_type_t, Box > {}; diff --git a/include/boost/geometry/strategies/distance_result.hpp b/include/boost/geometry/strategies/distance_result.hpp index 6d6520a279..0e07b28d7c 100644 --- a/include/boost/geometry/strategies/distance_result.hpp +++ b/include/boost/geometry/strategies/distance_result.hpp @@ -83,8 +83,8 @@ struct distance_result : strategy::distance::services::return_type < typename distance_result_strategy_type::type, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t > {}; diff --git a/include/boost/geometry/strategies/geographic/distance_cross_track_box_box.hpp b/include/boost/geometry/strategies/geographic/distance_cross_track_box_box.hpp index 7844cddebd..fed9a670a6 100644 --- a/include/boost/geometry/strategies/geographic/distance_cross_track_box_box.hpp +++ b/include/boost/geometry/strategies/geographic/distance_cross_track_box_box.hpp @@ -83,8 +83,8 @@ class geographic_cross_track_box_box struct return_type : services::return_type < typename distance_ps_strategy::type, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t > {}; @@ -105,8 +105,8 @@ class geographic_cross_track_box_box (concepts::PointSegmentDistanceStrategy < Strategy, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t >) ); #endif @@ -208,8 +208,8 @@ struct result_from_distance result_from_distance < Strategy, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t >::apply(strategy, distance); } }; diff --git a/include/boost/geometry/strategies/geographic/distance_cross_track_point_box.hpp b/include/boost/geometry/strategies/geographic/distance_cross_track_point_box.hpp index 4709b01903..e4dea34772 100644 --- a/include/boost/geometry/strategies/geographic/distance_cross_track_point_box.hpp +++ b/include/boost/geometry/strategies/geographic/distance_cross_track_point_box.hpp @@ -69,7 +69,7 @@ class geographic_cross_track_point_box template struct return_type : services::return_type::type> + Point, point_type_t> {}; //constructor @@ -88,7 +88,7 @@ class geographic_cross_track_point_box ( (concepts::PointSegmentDistanceStrategy < - Strategy, Point, typename point_type::type + Strategy, Point, point_type_t >) ); #endif @@ -190,7 +190,7 @@ struct result_from_distance { result_from_distance < - Strategy, P, typename point_type::type + Strategy, P, point_type_t >::apply(strategy, distance); } }; diff --git a/include/boost/geometry/strategies/spherical/disjoint_segment_box.hpp b/include/boost/geometry/strategies/spherical/disjoint_segment_box.hpp index dbb7fe8f6e..ac4235f146 100644 --- a/include/boost/geometry/strategies/spherical/disjoint_segment_box.hpp +++ b/include/boost/geometry/strategies/spherical/disjoint_segment_box.hpp @@ -54,9 +54,7 @@ struct segment_box_spherical template static inline bool apply(Segment const& segment, Box const& box) { - typedef typename point_type::type segment_point_type; - typedef typename coordinate_type::type CT; - geometry::strategy::azimuth::spherical azimuth_strategy; + geometry::strategy::azimuth::spherical>> azimuth_strategy; return geometry::detail::disjoint::disjoint_segment_box_sphere_or_spheroid < diff --git a/include/boost/geometry/strategies/spherical/distance_cross_track_box_box.hpp b/include/boost/geometry/strategies/spherical/distance_cross_track_box_box.hpp index 9b778a7fe3..f021cf99ef 100644 --- a/include/boost/geometry/strategies/spherical/distance_cross_track_box_box.hpp +++ b/include/boost/geometry/strategies/spherical/distance_cross_track_box_box.hpp @@ -87,8 +87,8 @@ public : // this method assumes that the coordinates of the point and // the box are normalized - typedef typename point_type::type box_point_type1; - typedef typename point_type::type box_point_type2; + using box_point_type1 = point_type_t; + using box_point_type2 = point_type_t; box_point_type1 bottom_left1, bottom_right1, top_left1, top_right1; geometry::detail::assign_box_corners(box1, @@ -277,8 +277,8 @@ class cross_track_box_box template struct return_type : services::return_type::type, - typename point_type::type> + point_type_t, + point_type_t> {}; typedef typename Strategy::radius_type radius_type; @@ -338,8 +338,8 @@ class cross_track_box_box (concepts::PointDistanceStrategy < Strategy, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t >) ); #endif @@ -429,8 +429,8 @@ struct result_from_distance return result_from_distance < Strategy, - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t >::apply(s, distance); } }; @@ -455,7 +455,7 @@ struct default_strategy typename default_strategy < point_tag, point_tag, - typename point_type::type, typename point_type::type, + point_type_t, point_type_t, spherical_equatorial_tag, spherical_equatorial_tag >::type, Strategy diff --git a/include/boost/geometry/strategies/spherical/distance_cross_track_point_box.hpp b/include/boost/geometry/strategies/spherical/distance_cross_track_point_box.hpp index 8b5178ca40..c4c7fa79e8 100644 --- a/include/boost/geometry/strategies/spherical/distance_cross_track_point_box.hpp +++ b/include/boost/geometry/strategies/spherical/distance_cross_track_point_box.hpp @@ -65,7 +65,7 @@ public : // this method assumes that the coordinates of the point and // the box are normalized - typedef typename point_type::type box_point_type; + using box_point_type = point_type_t; box_point_type bottom_left, bottom_right, top_left, top_right; geometry::detail::assign_box_corners(box, @@ -83,7 +83,7 @@ public : ReturnType const pi = math::pi(); ReturnType const two_pi = math::two_pi(); - typedef typename point_type::type box_point_type; + using box_point_type = point_type_t; // First check if the point is within the band defined by the // minimum and maximum longitude of the box; if yes, determine @@ -205,7 +205,7 @@ class cross_track_point_box public: template struct return_type - : services::return_type::type> + : services::return_type> {}; typedef typename Strategy::radius_type radius_type; @@ -266,7 +266,7 @@ class cross_track_point_box ( (concepts::PointDistanceStrategy < - Strategy, Point, typename point_type::type + Strategy, Point, point_type_t >) ); #endif @@ -354,7 +354,7 @@ struct result_from_distance return result_from_distance < - Strategy, P, typename point_type::type + Strategy, P, point_type_t >::apply(s, distance); } }; @@ -379,7 +379,7 @@ struct default_strategy typename default_strategy < point_tag, point_tag, - Point, typename point_type::type, + Point, point_type_t, spherical_equatorial_tag, spherical_equatorial_tag >::type, Strategy diff --git a/include/boost/geometry/strategy/relate.hpp b/include/boost/geometry/strategy/relate.hpp index a048e91aab..507d5ad051 100644 --- a/include/boost/geometry/strategy/relate.hpp +++ b/include/boost/geometry/strategy/relate.hpp @@ -95,11 +95,7 @@ struct default_intersection_strategy template struct default_point_in_geometry_strategy - : point_in_geometry::services::default_strategy - < - typename point_type::type, - Geometry - > + : point_in_geometry::services::default_strategy, Geometry> {}; } // namespace detail diff --git a/include/boost/geometry/strategy/spherical/envelope_multipoint.hpp b/include/boost/geometry/strategy/spherical/envelope_multipoint.hpp index 7302c41bea..049360892a 100644 --- a/include/boost/geometry/strategy/spherical/envelope_multipoint.hpp +++ b/include/boost/geometry/strategy/spherical/envelope_multipoint.hpp @@ -210,8 +210,8 @@ class spherical_multipoint template static inline void apply(MultiPoint const& multipoint, Box& mbr) { - typedef typename point_type::type point_type; - typedef typename coordinate_type::type coordinate_type; + using point_type = point_type_t; + using coordinate_type = coordinate_type_t; typedef math::detail::constants_on_spheroid < coordinate_type, diff --git a/include/boost/geometry/strategy/spherical/envelope_point.hpp b/include/boost/geometry/strategy/spherical/envelope_point.hpp index d11b38b217..9a52d9176f 100644 --- a/include/boost/geometry/strategy/spherical/envelope_point.hpp +++ b/include/boost/geometry/strategy/spherical/envelope_point.hpp @@ -52,7 +52,7 @@ struct spherical_point Point normalized_point; strategy::normalize::spherical_point::apply(point, normalized_point); - typename point_type::type box_point; + point_type_t box_point; // transform units of input point to units of a box point geometry::detail::envelope::transform_units(normalized_point, box_point); diff --git a/include/boost/geometry/strategy/spherical/expand_point.hpp b/include/boost/geometry/strategy/spherical/expand_point.hpp index 6260d90f21..e3a8793567 100644 --- a/include/boost/geometry/strategy/spherical/expand_point.hpp +++ b/include/boost/geometry/strategy/spherical/expand_point.hpp @@ -61,15 +61,14 @@ struct point_loop_on_spheroid template static inline void apply(Box& box, Point const& point) { - typedef typename point_type::type box_point_type; - typedef typename coordinate_type::type box_coordinate_type; - typedef typename geometry::detail::cs_angular_units::type units_type; - - typedef math::detail::constants_on_spheroid + using box_point_type = point_type_t; + using box_coordinate_type = coordinate_type_t; + using units_type = typename geometry::detail::cs_angular_units::type; + using constants = math::detail::constants_on_spheroid < box_coordinate_type, units_type - > constants; + >; // normalize input point and input box Point p_normalized; diff --git a/include/boost/geometry/util/is_inverse_spheroidal_coordinates.hpp b/include/boost/geometry/util/is_inverse_spheroidal_coordinates.hpp index 8bae1ecf76..3e9e7bd000 100644 --- a/include/boost/geometry/util/is_inverse_spheroidal_coordinates.hpp +++ b/include/boost/geometry/util/is_inverse_spheroidal_coordinates.hpp @@ -25,8 +25,8 @@ namespace boost { namespace geometry template bool is_inverse_spheroidal_coordinates(Box const& box) { - typedef typename point_type::type point_type; - typedef typename coordinate_type::type bound_type; + using point_type = point_type_t; + using bound_type = coordinate_type_t; bound_type const high = util::bounds::highest(); bound_type const low = util::bounds::lowest(); diff --git a/test/algorithms/similarity/test_frechet_distance.hpp b/test/algorithms/similarity/test_frechet_distance.hpp index cca0285252..201bc0ce14 100644 --- a/test/algorithms/similarity/test_frechet_distance.hpp +++ b/test/algorithms/similarity/test_frechet_distance.hpp @@ -28,8 +28,8 @@ void test_frechet_distance(Geometry1 const& geometry1,Geometry2 const& geometry2 using namespace bg; typedef typename distance_result < - typename point_type::type, - typename point_type::type + point_type_t, + point_type_t >::type result_type; result_type h_distance = bg::discrete_frechet_distance(geometry1,geometry2); @@ -81,8 +81,8 @@ void test_frechet_distance(Geometry1 const& geometry1,Geometry2 const& geometry2 using namespace bg; typedef typename distance_result < - typename point_type::type, - typename point_type::type, + point_type_t, + point_type_t, Strategy >::type result_type; result_type h_distance = bg::discrete_frechet_distance(geometry1,geometry2,strategy); diff --git a/test/robustness/common/make_square_polygon.hpp b/test/robustness/common/make_square_polygon.hpp index a40eda790a..2127a6b177 100644 --- a/test/robustness/common/make_square_polygon.hpp +++ b/test/robustness/common/make_square_polygon.hpp @@ -16,8 +16,8 @@ inline void make_square_polygon(Polygon& polygon, Generator& generator, Settings { using namespace boost::geometry; - typedef typename point_type::type point_type; - typedef typename coordinate_type::type coordinate_type; + using point_type = point_type_t; + using coordinate_type = coordinate_type_t; coordinate_type x, y; x = generator(); diff --git a/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp b/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp index 9747d1f940..83ee49f7f1 100644 --- a/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp +++ b/test/robustness/overlay/linear_areal/recursive_polygons_linear_areal.cpp @@ -77,8 +77,8 @@ inline void make_random_linestring(Linestring& line, Generator& generator, Setti { using namespace boost::geometry; - typedef typename point_type::type point_type; - typedef typename coordinate_type::type coordinate_type; + using point_type = point_type_t; + using coordinate_type = coordinate_type_t; coordinate_type x, y; x = generator();