From 6640b92eb81832d03fef822d105e9a5c8b9a7254 Mon Sep 17 00:00:00 2001 From: Barend Gehrels Date: Tue, 5 Nov 2024 20:17:22 +0100 Subject: [PATCH] chore: replace typedef with using in overlay --- .../detail/buffer/buffer_inserter.hpp | 6 +-- .../detail/buffer/buffer_policies.hpp | 4 +- .../buffer/buffered_piece_collection.hpp | 40 +++++++++---------- .../detail/buffer/buffered_ring.hpp | 2 +- .../detail/buffer/get_piece_turns.hpp | 13 +++--- .../detail/buffer/implementation.hpp | 2 +- .../algorithms/detail/buffer/piece_border.hpp | 2 +- .../detail/intersection/areal_areal.hpp | 24 +++++------ .../detail/intersection/interface.hpp | 10 ++--- .../algorithms/detail/overlay/add_rings.hpp | 2 +- .../detail/overlay/assign_parents.hpp | 2 +- .../detail/overlay/backtrack_check_si.hpp | 4 +- .../detail/overlay/clip_linestring.hpp | 4 +- .../algorithms/detail/overlay/follow.hpp | 16 ++++---- .../detail/overlay/follow_linear_linear.hpp | 30 +++++++------- .../overlay/get_intersection_points.hpp | 22 +++++----- .../detail/overlay/get_turn_info.hpp | 4 +- .../overlay/get_turn_info_for_endpoint.hpp | 2 +- .../detail/overlay/get_turn_info_helpers.hpp | 18 ++++----- .../detail/overlay/get_turn_info_la.hpp | 6 +-- .../detail/overlay/get_turn_info_ll.hpp | 4 +- .../algorithms/detail/overlay/get_turns.hpp | 26 ++++++------ .../detail/overlay/handle_colocations.hpp | 15 ++++--- .../detail/overlay/intersection_insert.hpp | 30 +++++++------- .../detail/overlay/less_by_segment_ratio.hpp | 2 +- .../detail/overlay/linear_linear.hpp | 6 +-- .../detail/overlay/needs_self_turns.hpp | 2 +- .../algorithms/detail/overlay/overlay.hpp | 4 +- .../detail/overlay/pointlike_areal.hpp | 4 +- .../detail/overlay/pointlike_linear.hpp | 8 ++-- .../detail/overlay/pointlike_pointlike.hpp | 6 +-- .../detail/overlay/range_in_geometry.hpp | 4 +- .../detail/overlay/ring_properties.hpp | 4 +- .../detail/overlay/select_rings.hpp | 2 +- .../detail/overlay/traversal_ring_creator.hpp | 10 ++--- .../algorithms/detail/overlay/turn_info.hpp | 12 +++--- 36 files changed, 175 insertions(+), 177 deletions(-) diff --git a/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp b/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp index 00592a446f..02e1bf9901 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp @@ -221,10 +221,10 @@ struct buffer_range { boost::ignore_unused(segment_strategy); - typedef typename std::iterator_traits + using point_type = typename std::iterator_traits < Iterator - >::value_type point_type; + >::value_type; point_type second_point, penultimate_point, ultimate_point; // last two points from begin/end @@ -469,7 +469,7 @@ struct buffer_inserter_ring { output_point_type first_p1, first_p2, last_p1, last_p2; - typedef detail::buffer::buffer_range buffer_range; + using buffer_range = detail::buffer::buffer_range; geometry::strategy::buffer::result_code result = buffer_range::iterate(collection, begin, end, diff --git a/include/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp b/include/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp index e843b27d90..4f2b8f0a82 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffer_policies.hpp @@ -39,7 +39,7 @@ namespace detail { namespace buffer class backtrack_for_buffer { public : - typedef detail::overlay::backtrack_state state_type; + using state_type = detail::overlay::backtrack_state; template < @@ -148,7 +148,7 @@ struct buffer_turn_info buffer_turn_operation > { - typedef Point point_type; + using point_type = Point; std::size_t turn_index; diff --git a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp index 1a35c61df2..9a836375c9 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -128,25 +128,25 @@ struct buffered_piece_collection using coordinate_type = geometry::coordinate_type_t; // Ring/polygon type, always clockwise - typedef geometry::model::ring clockwise_ring_type; + using clockwise_ring_type = geometry::model::ring; - typedef geometry::model::box box_type; + using box_type = geometry::model::box; - typedef buffer_turn_info + using buffer_turn_info_type = buffer_turn_info < point_type, typename segment_ratio_type::type - > buffer_turn_info_type; + >; - typedef buffer_turn_operation + using buffer_turn_operation_type = buffer_turn_operation < point_type, typename segment_ratio_type::type - > buffer_turn_operation_type; + >; - typedef std::vector turn_vector_type; + using turn_vector_type = std::vector; - typedef piece_border piece_border_type; + using piece_border_type = piece_border ; struct piece { @@ -203,7 +203,7 @@ struct buffered_piece_collection struct original_ring { - typedef geometry::sections sections_type; + using sections_type = geometry::sections; // Creates an empty instance inline original_ring() @@ -224,7 +224,7 @@ struct buffered_piece_collection // The dimension is critical because the direction is later used // in the optimization for within checks using winding strategy // and this strategy is scanning in x direction. - typedef std::integer_sequence dimensions; + using dimensions = std::integer_sequence; geometry::sectionalize < false, dimensions @@ -239,7 +239,7 @@ struct buffered_piece_collection bool m_has_interiors; }; - typedef std::vector piece_vector_type; + using piece_vector_type = std::vector; piece_vector_type m_pieces; turn_vector_type m_turns; @@ -258,15 +258,15 @@ struct buffered_piece_collection segment_identifier current_segment_id; // Monotonic sections (used for offsetted rings around points) - typedef geometry::sections sections_type; + using sections_type = geometry::sections; sections_type monotonic_sections; // Define the clusters, mapping cluster_id -> turns - typedef std::map + using cluster_type = std::map < signed_size_type, detail::overlay::cluster_info - > cluster_type; + >; cluster_type m_clusters; @@ -1028,14 +1028,14 @@ struct buffered_piece_collection inline void traverse() { - typedef detail::overlay::traverse + using traverser = detail::overlay::traverse < false, false, buffered_ring_collection >, buffered_ring_collection >, overlay_buffer, backtrack_for_buffer - > traverser; + >; std::map turn_info_per_ring; traversed_rings.clear(); @@ -1065,14 +1065,14 @@ struct buffered_piece_collection template inline OutputIterator assign(OutputIterator out) const { - typedef typename geometry::area_result + using area_result_type = typename geometry::area_result < buffered_ring, Strategy - >::type area_result_type; - typedef detail::overlay::ring_properties + >::type; + using properties = detail::overlay::ring_properties < point_type, area_result_type - > properties; + >; std::map selected; diff --git a/include/boost/geometry/algorithms/detail/buffer/buffered_ring.hpp b/include/boost/geometry/algorithms/detail/buffer/buffered_ring.hpp index 5bf34cd57a..00f3efa5e7 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_ring.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_ring.hpp @@ -154,7 +154,7 @@ struct ring_type detail::buffer::buffered_ring_collection > { - typedef Ring type; + using type = Ring; }; diff --git a/include/boost/geometry/algorithms/detail/buffer/get_piece_turns.hpp b/include/boost/geometry/algorithms/detail/buffer/get_piece_turns.hpp index a0fb8403cb..9c9509ce72 100644 --- a/include/boost/geometry/algorithms/detail/buffer/get_piece_turns.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/get_piece_turns.hpp @@ -190,8 +190,8 @@ class piece_turn_visitor inline void calculate_turns(Piece const& piece1, Piece const& piece2, Section const& section1, Section const& section2) { - typedef typename boost::range_value::type ring_type; - typedef typename boost::range_value::type turn_type; + using ring_type = typename boost::range_value::type; + using turn_type = typename boost::range_value::type; signed_size_type const piece1_first_index = piece1.first_seg_id.segment_index; signed_size_type const piece2_first_index = piece2.first_seg_id.segment_index; @@ -261,10 +261,10 @@ class piece_turn_visitor { unique_sub_range_from_piece unique_sub_range2(ring2, prev2, it2); - typedef detail::overlay::get_turn_info + using turn_policy = detail::overlay::get_turn_info < detail::overlay::assign_policy_only_start_turns - > turn_policy; + >; turn_policy::apply(unique_sub_range1, unique_sub_range2, the_model, @@ -292,9 +292,8 @@ class piece_turn_visitor { boost::ignore_unused(first); - typedef typename boost::range_value::type piece_type; - piece_type const& piece1 = m_pieces[section1.ring_id.source_index]; - piece_type const& piece2 = m_pieces[section2.ring_id.source_index]; + auto const& piece1 = m_pieces[section1.ring_id.source_index]; + auto const& piece2 = m_pieces[section2.ring_id.source_index]; if ( piece1.index == piece2.index || is_adjacent(piece1, piece2) diff --git a/include/boost/geometry/algorithms/detail/buffer/implementation.hpp b/include/boost/geometry/algorithms/detail/buffer/implementation.hpp index a9608a440e..0f7a87bc83 100644 --- a/include/boost/geometry/algorithms/detail/buffer/implementation.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/implementation.hpp @@ -76,7 +76,7 @@ struct buffer_all PointStrategy const& point_strategy, Strategies const& strategies) { - typedef typename boost::range_value::type polygon_type; + using polygon_type = typename boost::range_value::type; if (geometry::is_empty(geometry_in)) { diff --git a/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp b/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp index 156f7b3c5d..60a42554a2 100644 --- a/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp @@ -475,7 +475,7 @@ private : template inline void calculate_radii(Point const& center, It begin, It end) { - typedef geometry::model::referring_segment segment_type; + using segment_type = geometry::model::referring_segment; bool first = true; diff --git a/include/boost/geometry/algorithms/detail/intersection/areal_areal.hpp b/include/boost/geometry/algorithms/detail/intersection/areal_areal.hpp index 3f5d43886a..cea95807e0 100644 --- a/include/boost/geometry/algorithms/detail/intersection/areal_areal.hpp +++ b/include/boost/geometry/algorithms/detail/intersection/areal_areal.hpp @@ -75,10 +75,10 @@ struct intersection_areal_areal_ TupledOut& geometry_out, Strategy const& strategy) { - typedef typename geometry::detail::output_geometry_value + using single_out = typename geometry::detail::output_geometry_value < TupledOut - >::type single_out; + >::type; boost::ignore_unused < @@ -89,18 +89,18 @@ struct intersection_areal_areal_ > >(); - typedef geometry::detail::output_geometry_access + using areal = geometry::detail::output_geometry_access < single_out, polygon_tag, polygon_tag - > areal; - typedef geometry::detail::output_geometry_access + >; + using linear = geometry::detail::output_geometry_access < single_out, linestring_tag, linestring_tag - > linear; - typedef geometry::detail::output_geometry_access + >; + using pointlike = geometry::detail::output_geometry_access < single_out, point_tag, point_tag - > pointlike; + >; // A * A -> A call_intersection(areal1, areal2, @@ -124,15 +124,15 @@ struct intersection_areal_areal_ // however this results in static assert failure related to rescale policy // After the removing of rescaling replacing boundary with areal geometry results in // some tests failing. - typedef typename geometry::tuples::element + using areal_out_type = typename geometry::tuples::element < areal::index, TupledOut - >::type areal_out_type; + >::type; - typedef geometry::detail::boundary_view + using areal_out_boundary_type = geometry::detail::boundary_view < areal_out_type const - > areal_out_boundary_type; + >; areal_out_boundary_type areal_out_boundary(areal::get(geometry_out)); diff --git a/include/boost/geometry/algorithms/detail/intersection/interface.hpp b/include/boost/geometry/algorithms/detail/intersection/interface.hpp index 7a9a190e6b..ee52ca3c0b 100644 --- a/include/boost/geometry/algorithms/detail/intersection/interface.hpp +++ b/include/boost/geometry/algorithms/detail/intersection/interface.hpp @@ -49,14 +49,14 @@ struct intersection GeometryOut& geometry_out, Strategy const& strategy) { - typedef typename geometry::detail::output_geometry_value + using single_out = typename geometry::detail::output_geometry_value < GeometryOut - >::type SingleOut; + >::type; intersection_insert < - Geometry1, Geometry2, SingleOut, + Geometry1, Geometry2, single_out, overlay_intersection >::apply(geometry1, geometry2, geometry::detail::output_geometry_back_inserter(geometry_out), @@ -195,10 +195,10 @@ struct intersection GeometryOut & geometry_out, default_strategy) { - typedef typename strategies::relate::services::default_strategy + using strategy_type = typename strategies::relate::services::default_strategy < Geometry1, Geometry2 - >::type strategy_type; + >::type; return intersection < diff --git a/include/boost/geometry/algorithms/detail/overlay/add_rings.hpp b/include/boost/geometry/algorithms/detail/overlay/add_rings.hpp index e177c33ff8..a253b58d70 100644 --- a/include/boost/geometry/algorithms/detail/overlay/add_rings.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/add_rings.hpp @@ -133,7 +133,7 @@ inline OutputIterator add_rings(SelectionMap const& map, // everything is figured out yet (sum of positive/negative rings) if (geometry::num_points(result) >= min_num_points) { - typedef typename geometry::area_result::type area_type; + using area_type = typename geometry::area_result::type; area_type const area = geometry::area(result, strategy); area_type const zero = 0; // Ignore if area is 0 diff --git a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp index 1d60a46951..ad775e7aae 100644 --- a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp @@ -178,7 +178,7 @@ template > struct assign_visitor { - typedef typename RingMap::mapped_type ring_info_type; + using ring_info_type = typename RingMap::mapped_type; Geometry1 const& m_geometry1; Geometry2 const& m_geometry2; diff --git a/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp b/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp index 2f8e6314ac..517d881db3 100644 --- a/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp @@ -100,7 +100,7 @@ class backtrack_check_self_intersections {} }; public : - typedef state state_type; + using state_type = state; template < @@ -155,7 +155,7 @@ template class backtrack_debug { public : - typedef backtrack_state state_type; + using state_type = backtrack_state; template static inline void apply(std::size_t size_at_start, diff --git a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp index e1b56bf47a..b5b223ef7e 100644 --- a/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/clip_linestring.hpp @@ -54,7 +54,7 @@ template class liang_barsky { private: - typedef model::referring_segment segment_type; + using segment_type = model::referring_segment; template inline bool check_edge(CoordinateType const& p, CoordinateType const& q, CalcType& t1, CalcType& t2) const @@ -90,7 +90,7 @@ class liang_barsky // TODO: Temporary, this strategy should be moved, it is cartesian-only - typedef strategy::within::cartesian_point_point equals_point_point_strategy_type; + using equals_point_point_strategy_type = strategy::within::cartesian_point_point; static inline equals_point_point_strategy_type get_equals_point_point_strategy() { diff --git a/include/boost/geometry/algorithms/detail/overlay/follow.hpp b/include/boost/geometry/algorithms/detail/overlay/follow.hpp index e9c9aef467..aeca332d9a 100644 --- a/include/boost/geometry/algorithms/detail/overlay/follow.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/follow.hpp @@ -297,7 +297,7 @@ struct action_selector template struct action_selector { - typedef action_selector normal_action; + using normal_action = action_selector; template < @@ -382,14 +382,14 @@ template > class follow { - typedef geometry::detail::output_geometry_access + using linear = geometry::detail::output_geometry_access < GeometryOut, linestring_tag, linestring_tag - > linear; - typedef geometry::detail::output_geometry_access + >; + using pointlike = geometry::detail::output_geometry_access < GeometryOut, point_tag, linestring_tag - > pointlike; + >; public : @@ -413,17 +413,17 @@ public : OutputIterator out, Strategy const& strategy) { - typedef following::action_selector action; + using action = following::action_selector; // Sort intersection points on segments-along-linestring, and distance // (like in enrich is done for poly/poly) // sort turns by Linear seg_id, then by fraction, then // for same ring id: x, u, i, c // for different ring id: c, i, u, x - typedef relate::turns::less + using turn_less = relate::turns::less < 0, relate::turns::less_op_linear_areal_single<0>, Strategy - > turn_less; + >; std::sort(boost::begin(turns), boost::end(turns), turn_less()); typename linear::type current_piece; diff --git a/include/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp b/include/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp index bcac7da2e9..f840df8613 100644 --- a/include/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/follow_linear_linear.hpp @@ -181,16 +181,16 @@ class follow_linestring_linear { protected: // allow spikes (false indicates: do not remove spikes) - typedef following::action_selector action; + using action = following::action_selector; - typedef geometry::detail::output_geometry_access + using linear = geometry::detail::output_geometry_access < GeometryOut, linestring_tag, linestring_tag - > linear; - typedef geometry::detail::output_geometry_access + >; + using pointlike = geometry::detail::output_geometry_access < GeometryOut, point_tag, linestring_tag - > pointlike; + >; template < @@ -363,20 +363,20 @@ class follow_multilinestring_linear > { protected: - typedef typename boost::range_value::type Linestring; + using linestring_t = typename boost::range_value::type; - typedef follow_linestring_linear + using base_t = follow_linestring_linear < - LinestringOut, Linestring, Linear, + LinestringOut, linestring_t, Linear, OverlayType, FollowIsolatedPoints, FollowContinueTurns - > Base; + >; - typedef following::action_selector action; + using action = following::action_selector; - typedef typename boost::range_iterator + using linestring_iterator = typename boost::range_iterator < MultiLinestring const - >::type linestring_iterator; + >::type; template @@ -439,10 +439,10 @@ class follow_multilinestring_linear { BOOST_GEOMETRY_ASSERT( first != beyond ); - typedef copy_linestrings_in_range + using copy_linestrings = copy_linestrings_in_range < OutputIterator, OverlayType - > copy_linestrings; + >; linestring_iterator ls_first = boost::begin(multilinestring); linestring_iterator ls_beyond = boost::end(multilinestring); @@ -464,7 +464,7 @@ class follow_multilinestring_linear per_ls_next = std::find_if(per_ls_current, beyond, has_other_multi_id(current_multi_id)); - oit = Base::apply(*(ls_first + current_multi_id), + oit = base_t::apply(*(ls_first + current_multi_id), linear, per_ls_current, per_ls_next, oit, strategy); signed_size_type next_multi_id = -1; 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 99753bfbd1..a2b3058f18 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_intersection_points.hpp @@ -55,12 +55,12 @@ struct get_turn_without_info Strategy const& strategy, OutputIterator out) { - typedef typename TurnInfo::point_type turn_point_type; + using turn_point_type = typename TurnInfo::point_type; - typedef policies::relate::segments_intersection_points + using policy_type = policies::relate::segments_intersection_points < segment_intersection_points - > policy_type; + >; typename policy_type::return_type const result = strategy.relate().apply(range_p, range_q, policy_type()); @@ -96,12 +96,12 @@ inline void get_intersection_points(Geometry1 const& geometry1, { concepts::check_concepts_and_equal_dimensions(); - typedef detail::get_intersection_points::get_turn_without_info - < - point_type_t, - point_type_t, - typename boost::range_value::type - > TurnPolicy; + using turn_policy_t = detail::get_intersection_points::get_turn_without_info + < + point_type_t, + point_type_t, + typename boost::range_value::type + >; detail::get_turns::no_interrupt_policy interrupt_policy; @@ -114,7 +114,7 @@ inline void get_intersection_points(Geometry1 const& geometry1, tag_t, Geometry1, Geometry2, false, false, - TurnPolicy + turn_policy_t >, dispatch::get_turns < @@ -122,7 +122,7 @@ inline void get_intersection_points(Geometry1 const& geometry1, tag_t, Geometry1, Geometry2, false, false, - TurnPolicy + turn_policy_t > >::apply(0, geometry1, 1, geometry2, diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index ed1085e6e0..8a85d37302 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -1397,12 +1397,12 @@ struct get_turn_info UmbrellaStrategy const& umbrella_strategy, OutputIterator out) { - typedef intersection_info + using inters_info = intersection_info < UniqueSubRange1, UniqueSubRange2, typename TurnInfo::point_type, UmbrellaStrategy - > inters_info; + >; inters_info inters(range_p, range_q, umbrella_strategy); diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp index 229277abe3..59602625ed 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_for_endpoint.hpp @@ -231,7 +231,7 @@ class linear_intersections template struct get_turn_info_for_endpoint { - typedef std::pair operations_pair; + using operations_pair = std::pair; BOOST_STATIC_ASSERT(EnableFirst || EnableLast); diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp index 78288e685e..97be7a1a23 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_helpers.hpp @@ -48,7 +48,7 @@ template > struct side_calculator { - typedef decltype(std::declval().side()) side_strategy_type; + using side_strategy_type = decltype(std::declval().side()); inline side_calculator(UniqueSubRange1 const& range_p, UniqueSubRange2 const& range_q, @@ -97,23 +97,23 @@ class intersection_info_base { public: - typedef segment_intersection_points intersection_point_type; - typedef policies::relate::segments_intersection_policy + using intersection_point_type = segment_intersection_points; + using intersection_policy_type = policies::relate::segments_intersection_policy < intersection_point_type - > intersection_policy_type; + >; - typedef typename intersection_policy_type::return_type result_type; + using result_type = typename intersection_policy_type::return_type; - typedef side_calculator + using side_calculator_type = side_calculator < UniqueSubRange1, UniqueSubRange2, UmbrellaStrategy - > side_calculator_type; + >; - typedef side_calculator + using swapped_side_calculator_type = side_calculator < UniqueSubRange2, UniqueSubRange1, UmbrellaStrategy - > swapped_side_calculator_type; + >; intersection_info_base(UniqueSubRange1 const& range_p, UniqueSubRange2 const& range_q, diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp index 95e6ed6698..15ce805b71 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_la.hpp @@ -54,12 +54,12 @@ struct get_turn_info_linear_areal UmbrellaStrategy const& umbrella_strategy, OutputIterator out) { - typedef intersection_info + using inters_info = intersection_info < UniqueSubRange1, UniqueSubRange2, typename TurnInfo::point_type, UmbrellaStrategy - > inters_info; + >; inters_info inters(range_p, range_q, umbrella_strategy); @@ -702,7 +702,7 @@ struct get_turn_info_linear_areal Strategy const& strategy) { namespace ov = overlay; - typedef ov::get_turn_info_for_endpoint get_info_e; + using get_info_e = ov::get_turn_info_for_endpoint; std::size_t const ip_count = inters.i_info().count; // no intersection points diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp index 00349f29c0..0831340d86 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info_ll.hpp @@ -49,12 +49,12 @@ struct get_turn_info_linear_linear UmbrellaStrategy const& umbrella_strategy, OutputIterator out) { - typedef intersection_info + using inters_info = intersection_info < UniqueSubRange1, UniqueSubRange2, typename TurnInfo::point_type, UmbrellaStrategy - > inters_info; + >; inters_info inters(range_p, range_q, umbrella_strategy); diff --git a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp index 755a928562..62b9502a95 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turns.hpp @@ -357,7 +357,7 @@ public : *prev2, *it2, strategy); - typedef typename boost::range_value::type turn_info; + using turn_info = typename boost::range_value::type; turn_info ti; ti.operations[0].seg_id @@ -496,14 +496,14 @@ class get_turns_generic InterruptPolicy& interrupt_policy) { // First create monotonic sections... - typedef typename boost::range_value::type ip_type; - typedef typename ip_type::point_type point_type; + using ip_type = typename boost::range_value::type; + using point_type = typename ip_type::point_type; - typedef model::box box_type; - typedef geometry::sections sections_type; + using box_type = model::box; + using sections_type = geometry::sections; sections_type sec1, sec2; - typedef std::integer_sequence dimensions; + using dimensions = std::integer_sequence; geometry::sectionalize(geometry1, sec1, strategy, 0); @@ -555,7 +555,7 @@ struct get_turns_cs struct unique_sub_range_from_box_policy { - typedef box_point_type point_type; + using point_type = box_point_type; unique_sub_range_from_box_policy(box_array const& box) : m_box(box) @@ -584,7 +584,7 @@ struct get_turns_cs struct unique_sub_range_from_view_policy { - typedef range_point_type point_type; + using point_type = range_point_type; unique_sub_range_from_view_policy(view_type const& view, point_type const& pi, point_type const& pj, iterator_type it) : m_view(view) @@ -684,7 +684,7 @@ struct get_turns_cs // Depending on code some relations can be left out - typedef typename boost::range_value::type turn_info; + using turn_info = typename boost::range_value::type; turn_info ti; ti.operations[0].seg_id = seg_id; @@ -1014,8 +1014,8 @@ inline void get_turns(Geometry1 const& geometry1, { concepts::check_concepts_and_equal_dimensions(); - typedef detail::overlay::get_turn_info TurnPolicy; - //typedef detail::get_turns::get_turn_info_type TurnPolicy; + using turn_policy_t = detail::overlay::get_turn_info; + //using turn_policy_t = detail::get_turns::get_turn_info_type; std::conditional_t < @@ -1026,7 +1026,7 @@ inline void get_turns(Geometry1 const& geometry1, tag_t, Geometry1, Geometry2, Reverse1, Reverse2, - TurnPolicy + turn_policy_t >, dispatch::get_turns < @@ -1034,7 +1034,7 @@ inline void get_turns(Geometry1 const& geometry1, tag_t, Geometry1, Geometry2, Reverse1, Reverse2, - TurnPolicy + turn_policy_t > >::apply(0, geometry1, 1, geometry2, diff --git a/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp b/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp index fa5f52c593..d4f9ec19af 100644 --- a/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp @@ -260,7 +260,7 @@ template inline void check_colocation(bool& has_blocked, signed_size_type cluster_id, Turns const& turns, Clusters const& clusters) { - typedef typename boost::range_value::type turn_type; + using turn_type = typename boost::range_value::type; has_blocked = false; @@ -431,16 +431,15 @@ inline void gather_cluster_properties(Clusters& clusters, Turns& turns, Geometry1 const& geometry1, Geometry2 const& geometry2, Strategy const& strategy) { - typedef typename boost::range_value::type turn_type; - typedef typename turn_type::point_type point_type; - typedef typename turn_type::turn_operation_type turn_operation_type; + using turn_type = typename boost::range_value::type; + using point_type = typename turn_type::point_type; + using turn_operation_type = typename turn_type::turn_operation_type; - // Define sorter, sorting counter-clockwise such that polygons are on the - // right side - typedef sort_by_side::side_sorter + // Define sorter, sorting counter-clockwise such that polygons are on the right side + using sbs_type = sort_by_side::side_sorter < Reverse1, Reverse2, OverlayType, point_type, Strategy, std::less - > sbs_type; + >; for (auto& pair : clusters) { diff --git a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp index ce54f17f5c..35c919255c 100644 --- a/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/intersection_insert.hpp @@ -117,7 +117,7 @@ struct intersection_linestring_linestring_point OutputIterator out, Strategy const& strategy) { - typedef detail::overlay::turn_info turn_info; + using turn_info = detail::overlay::turn_info; std::deque turns; geometry::get_intersection_points(linestring1, linestring2, @@ -269,7 +269,7 @@ struct intersection_of_linestring_with_areal return out; } - typedef detail::overlay::follow + using follower = detail::overlay::follow < GeometryOut, LineString, @@ -277,21 +277,21 @@ struct intersection_of_linestring_with_areal OverlayType, false, // do not remove spikes for linear geometries FollowIsolatedPoints - > follower; + >; - typedef typename geometry::detail::output_geometry_access + using linear = typename geometry::detail::output_geometry_access < GeometryOut, linestring_tag, linestring_tag - > linear; + >; using point_type = point_type_t; - typedef geometry::segment_ratio + using ratio_type = geometry::segment_ratio < coordinate_type_t - > ratio_type; + >; - typedef detail::overlay::turn_info + using turn_info = detail::overlay::turn_info < point_type, ratio_type, @@ -300,16 +300,16 @@ struct intersection_of_linestring_with_areal point_type, ratio_type > - > turn_info; + >; std::deque turns; detail::get_turns::no_interrupt_policy policy; - typedef detail::overlay::get_turn_info_linear_areal + using turn_policy = detail::overlay::get_turn_info_linear_areal < detail::overlay::assign_null_policy - > turn_policy; + >; dispatch::get_turns < @@ -387,11 +387,11 @@ struct intersection_areal_areal_point OutputIterator out, Strategy const& strategy) { - typedef detail::overlay::turn_info + using turn_info = detail::overlay::turn_info < PointOut, typename segment_ratio_type::type - > turn_info; + >; std::vector turns; detail::get_turns::no_interrupt_policy policy; @@ -1463,10 +1463,10 @@ inline OutputIterator intersection_insert(Geometry1 const& geometry1, concepts::check(); concepts::check(); - typedef typename strategies::relate::services::default_strategy + using strategy_type = typename strategies::relate::services::default_strategy < Geometry1, Geometry2 - >::type strategy_type; + >::type; return intersection_insert(geometry1, geometry2, out, strategy_type()); diff --git a/include/boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp b/include/boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp index 0a595f2f5c..a10017acc8 100644 --- a/include/boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/less_by_segment_ratio.hpp @@ -39,7 +39,7 @@ namespace detail { namespace overlay template struct indexed_turn_operation { - typedef TurnOperation type; + using type = TurnOperation; std::size_t turn_index; std::size_t operation_index; diff --git a/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp b/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp index 61ed6025f7..fd69ee32f8 100644 --- a/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/linear_linear.hpp @@ -227,7 +227,7 @@ class linear_linear_linestring OutputIterator oit, Strategy const& strategy) { - typedef typename detail::relate::turns::get_turns + using turn_info = typename detail::relate::turns::get_turns < Linear1, Linear2, @@ -237,9 +237,9 @@ class linear_linear_linestring Linear2, assign_policy > - >::template turn_info_type::type turn_info; + >::template turn_info_type::type; - typedef std::vector turns_container; + using turns_container = std::vector; turns_container turns; compute_turns(turns, linear1, linear2, strategy); diff --git a/include/boost/geometry/algorithms/detail/overlay/needs_self_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/needs_self_turns.hpp index 826a26e250..7adf419036 100644 --- a/include/boost/geometry/algorithms/detail/overlay/needs_self_turns.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/needs_self_turns.hpp @@ -69,7 +69,7 @@ struct needs_self_turns { static inline bool apply(Geometry const& multi) { - typedef typename boost::range_value::type polygon_type; + using polygon_type = typename boost::range_value::type; std::size_t const n = boost::size(multi); return n > 1 || (n == 1 && needs_self_turns diff --git a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp index e51e04d28e..972f79f036 100644 --- a/include/boost/geometry/algorithms/detail/overlay/overlay.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/overlay.hpp @@ -322,11 +322,11 @@ struct overlay get_ring_turn_info(turn_info_per_ring, turns, clusters); - typedef ring_properties + using properties = ring_properties < point_type, typename geometry::area_result::type - > properties; + >; // Select all rings which are NOT touched by any intersection point std::map selected_ring_properties; diff --git a/include/boost/geometry/algorithms/detail/overlay/pointlike_areal.hpp b/include/boost/geometry/algorithms/detail/overlay/pointlike_areal.hpp index 9a6cff29c7..497bc6651d 100644 --- a/include/boost/geometry/algorithms/detail/overlay/pointlike_areal.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/pointlike_areal.hpp @@ -217,10 +217,10 @@ class multipoint_multipolygon_point OutputIterator oit, Strategy const& strategy) { - typedef std::vector + using point_vector_type = std::vector < typename boost::range_value::type - > point_vector_type; + >; point_vector_type common_points; diff --git a/include/boost/geometry/algorithms/detail/overlay/pointlike_linear.hpp b/include/boost/geometry/algorithms/detail/overlay/pointlike_linear.hpp index bfb4880a11..c6a3cb58f8 100644 --- a/include/boost/geometry/algorithms/detail/overlay/pointlike_linear.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/pointlike_linear.hpp @@ -217,8 +217,8 @@ class multipoint_linear_point class segment_range { public: - typedef geometry::segment_iterator const_iterator; - typedef const_iterator iterator; + using const_iterator = geometry::segment_iterator; + using iterator = const_iterator; explicit segment_range(Linear const& linear) : m_linear(linear) @@ -273,10 +273,10 @@ class multipoint_linear_point OutputIterator oit, Strategy const& strategy) { - typedef std::vector + using point_vector_type = std::vector < typename boost::range_value::type - > point_vector_type; + >; point_vector_type common_points; diff --git a/include/boost/geometry/algorithms/detail/overlay/pointlike_pointlike.hpp b/include/boost/geometry/algorithms/detail/overlay/pointlike_pointlike.hpp index 834373755a..a0c0ab03c8 100644 --- a/include/boost/geometry/algorithms/detail/overlay/pointlike_pointlike.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/pointlike_pointlike.hpp @@ -221,7 +221,7 @@ struct point_multipoint_point OutputIterator oit, Strategy const& strategy) { - typedef action_selector_pl action; + using action = action_selector_pl; for (auto it = boost::begin(multipoint); it != boost::end(multipoint); ++it) { @@ -255,7 +255,7 @@ struct multipoint_multipoint_point OutputIterator oit, Strategy const& strategy) { - typedef geometry::less less_type; + using less_type = geometry::less; if BOOST_GEOMETRY_CONSTEXPR (OverlayType != overlay_difference) { @@ -268,7 +268,7 @@ struct multipoint_multipoint_point } } - typedef typename boost::range_value::type point2_type; + using point2_type = typename boost::range_value::type; std::vector points2(boost::begin(multipoint2), boost::end(multipoint2)); diff --git a/include/boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp b/include/boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp index 2e4d3764df..76f7ac2bfb 100644 --- a/include/boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/range_in_geometry.hpp @@ -33,7 +33,7 @@ template > struct points_range { - typedef geometry::point_iterator iterator_type; + using iterator_type = geometry::point_iterator; explicit points_range(Geometry const& geometry) : m_geometry(geometry) @@ -113,7 +113,7 @@ static inline int range_in_geometry(Geometry1 const& geometry1, { int result = 0; points_range points(geometry1); - typedef typename points_range::iterator_type iterator_type; + using iterator_type = typename points_range::iterator_type; iterator_type const end = points.end(); iterator_type it = points.begin(); if (it == end) diff --git a/include/boost/geometry/algorithms/detail/overlay/ring_properties.hpp b/include/boost/geometry/algorithms/detail/overlay/ring_properties.hpp index 4039891f74..f3f09e3ed2 100644 --- a/include/boost/geometry/algorithms/detail/overlay/ring_properties.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/ring_properties.hpp @@ -30,8 +30,8 @@ namespace detail { namespace overlay template struct ring_properties { - typedef Point point_type; - typedef AreaType area_type; + using point_type = Point; + using area_type = AreaType; bool valid; diff --git a/include/boost/geometry/algorithms/detail/overlay/select_rings.hpp b/include/boost/geometry/algorithms/detail/overlay/select_rings.hpp index 486a662c64..ab5a37e12f 100644 --- a/include/boost/geometry/algorithms/detail/overlay/select_rings.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/select_rings.hpp @@ -151,7 +151,7 @@ namespace dispatch ring_identifier id, RingPropertyMap& ring_properties, Strategy const& strategy) { - typedef select_rings::type> per_polygon; + using per_polygon = select_rings::type>; id.multi_index = 0; for (auto it = boost::begin(multi); it != boost::end(multi); ++it) diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp index 89d44b5b29..e59c9adea6 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp @@ -51,16 +51,16 @@ template > struct traversal_ring_creator { - typedef traversal + using traversal_type = traversal < Reverse1, Reverse2, OverlayType, Geometry1, Geometry2, Turns, Clusters, Strategy, Visitor - > traversal_type; + >; - typedef typename boost::range_value::type turn_type; - typedef typename turn_type::turn_operation_type turn_operation_type; + using turn_type = typename boost::range_value::type; + using turn_operation_type = typename turn_type::turn_operation_type; static const operation_type target_operation = operation_from_overlay::value; @@ -254,7 +254,7 @@ struct traversal_ring_creator Rings& rings, std::size_t& finalized_ring_size, typename Backtrack::state_type& state) { - typedef typename boost::range_value::type ring_type; + using ring_type = typename boost::range_value::type; turn_operation_type const& start_op = start_turn.operations[op_index]; diff --git a/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp index b2731346d4..f8cbabff47 100644 --- a/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/turn_info.hpp @@ -51,11 +51,11 @@ enum method_type template struct turn_operation { - typedef SegmentRatio segment_ratio_type; + using segment_ratio_type = SegmentRatio; operation_type operation; segment_identifier seg_id; - SegmentRatio fraction; + segment_ratio_type fraction; using comparable_distance_type = coordinate_type_t; comparable_distance_type remaining_distance; @@ -85,10 +85,10 @@ template > struct turn_info { - typedef Point point_type; - typedef SegmentRatio segment_ratio_type; - typedef Operation turn_operation_type; - typedef Container container_type; + using point_type = Point; + using segment_ratio_type = SegmentRatio; + using turn_operation_type = Operation; + using container_type = Container; Point point; method_type method;