diff --git a/include/boost/geometry/algorithms/assign.hpp b/include/boost/geometry/algorithms/assign.hpp index dabf1b4a57..5386ac6494 100644 --- a/include/boost/geometry/algorithms/assign.hpp +++ b/include/boost/geometry/algorithms/assign.hpp @@ -216,7 +216,7 @@ template struct assign { static inline void - apply(Geometry1& geometry1, const Geometry2& geometry2) + apply(Geometry1& geometry1, Geometry2 const& geometry2) { concepts::check(); concepts::check(); diff --git a/include/boost/geometry/algorithms/correct_closure.hpp b/include/boost/geometry/algorithms/correct_closure.hpp index 38d982c91b..0521c38b81 100644 --- a/include/boost/geometry/algorithms/correct_closure.hpp +++ b/include/boost/geometry/algorithms/correct_closure.hpp @@ -26,6 +26,7 @@ #include #include +#include namespace boost { namespace geometry { 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 8aa9493420..66943b303c 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -698,7 +698,7 @@ struct buffered_piece_collection BOOST_GEOMETRY_ASSERT(pc.offsetted_count >= 0); } - inline void add_piece_point(piece& pc, const point_type& point, bool add_to_original) + inline void add_piece_point(piece& pc, point_type const& point, bool add_to_original) { if (add_to_original && pc.type != strategy::buffer::buffered_concave) { diff --git a/include/boost/geometry/algorithms/detail/buffer/line_line_intersection.hpp b/include/boost/geometry/algorithms/detail/buffer/line_line_intersection.hpp index f1014c9bb4..f217c53b01 100644 --- a/include/boost/geometry/algorithms/detail/buffer/line_line_intersection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/line_line_intersection.hpp @@ -77,7 +77,7 @@ struct line_line_intersection // | pa pa | // | qb qb | auto const denominator_pq = determinant(p, q); - constexpr decltype(denominator_pq) const zero = 0; + static decltype(denominator_pq) const zero = 0; if (equidistant) { diff --git a/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp b/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp index d773d32c36..3861fcbe57 100644 --- a/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp @@ -18,6 +18,7 @@ #include #include +#include #include #include diff --git a/include/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp b/include/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp index daa59b618b..12fffc4c4a 100644 --- a/include/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/turn_in_original_visitor.hpp @@ -16,8 +16,9 @@ #include -#include +#include +#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/calculate_point_order.hpp b/include/boost/geometry/algorithms/detail/calculate_point_order.hpp index 191f71f3d8..5dc92a0cce 100644 --- a/include/boost/geometry/algorithms/detail/calculate_point_order.hpp +++ b/include/boost/geometry/algorithms/detail/calculate_point_order.hpp @@ -14,6 +14,8 @@ #include +#include + #include #include #include diff --git a/include/boost/geometry/algorithms/detail/closest_feature/point_to_range.hpp b/include/boost/geometry/algorithms/detail/closest_feature/point_to_range.hpp index ed2efd6fce..678502bce6 100644 --- a/include/boost/geometry/algorithms/detail/closest_feature/point_to_range.hpp +++ b/include/boost/geometry/algorithms/detail/closest_feature/point_to_range.hpp @@ -14,7 +14,6 @@ #include #include -#include #include #include 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 f59c85a9b5..2c0f22d5bd 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 @@ -12,6 +12,8 @@ #include +#include + #include #include #include diff --git a/include/boost/geometry/algorithms/detail/convex_hull/graham_andrew.hpp b/include/boost/geometry/algorithms/detail/convex_hull/graham_andrew.hpp index 64d81054e8..20fd09bf58 100644 --- a/include/boost/geometry/algorithms/detail/convex_hull/graham_andrew.hpp +++ b/include/boost/geometry/algorithms/detail/convex_hull/graham_andrew.hpp @@ -23,6 +23,8 @@ #include #include +#include + #include #include #include diff --git a/include/boost/geometry/algorithms/detail/convex_hull/interface.hpp b/include/boost/geometry/algorithms/detail/convex_hull/interface.hpp index b820cc4bf4..884a9278b3 100644 --- a/include/boost/geometry/algorithms/detail/convex_hull/interface.hpp +++ b/include/boost/geometry/algorithms/detail/convex_hull/interface.hpp @@ -24,6 +24,8 @@ #include +#include + #include #include #include 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 4424f144b0..1361811dab 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 @@ -22,6 +22,8 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISJOINT_LINEAR_SEGMENT_OR_BOX_HPP +#include + #include #include #include diff --git a/include/boost/geometry/algorithms/detail/distance/geometry_collection.hpp b/include/boost/geometry/algorithms/detail/distance/geometry_collection.hpp index f230958437..c3d079eb7b 100644 --- a/include/boost/geometry/algorithms/detail/distance/geometry_collection.hpp +++ b/include/boost/geometry/algorithms/detail/distance/geometry_collection.hpp @@ -12,6 +12,8 @@ #include +#include + #include #include #include diff --git a/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp b/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp index b908c3e535..40ea1e4245 100644 --- a/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp +++ b/include/boost/geometry/algorithms/detail/equals/collect_vectors.hpp @@ -21,6 +21,7 @@ #include +#include #include #include diff --git a/include/boost/geometry/algorithms/detail/intersection/gc.hpp b/include/boost/geometry/algorithms/detail/intersection/gc.hpp index fa492c0f34..38a10ba328 100644 --- a/include/boost/geometry/algorithms/detail/intersection/gc.hpp +++ b/include/boost/geometry/algorithms/detail/intersection/gc.hpp @@ -12,6 +12,8 @@ #include +#include + #include #include #include diff --git a/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp b/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp index 5af933de85..8b55ee85df 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include diff --git a/include/boost/geometry/algorithms/detail/is_valid/ring.hpp b/include/boost/geometry/algorithms/detail/is_valid/ring.hpp index e34f02f7f6..810b94a453 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/ring.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/ring.hpp @@ -15,6 +15,8 @@ #include +#include + #include #include @@ -38,12 +40,11 @@ #include #include -// TEMP - with UmberllaStrategy this will be not needed +// TEMP - with UmbrellaStrategy this will be not needed #include #include // TODO: use point_order instead of area - #ifdef BOOST_GEOMETRY_TEST_DEBUG #include #endif diff --git a/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp index 0af3c31c5a..c52266c190 100644 --- a/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp @@ -100,7 +100,7 @@ inline void append_no_dups_or_spikes(Range& range, Point const& point, return; } - auto append = [](auto& r, const auto& p) + auto append = [](auto& r, auto const& p) { using point_t = typename boost::range_value::type; point_t rp; diff --git a/include/boost/geometry/algorithms/detail/overlay/approximately_equals.hpp b/include/boost/geometry/algorithms/detail/overlay/approximately_equals.hpp index 31f9d7a63f..f41996f1dc 100644 --- a/include/boost/geometry/algorithms/detail/overlay/approximately_equals.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/approximately_equals.hpp @@ -22,11 +22,26 @@ namespace detail { namespace overlay { // Value for approximately_equals used by get_cluster and sort_by_side +// This is an "epsilon_multiplier" and, therefore, multiplied the epsilon +// belonging to the used floating point type with this value. template -struct common_approximately_equals_epsilon +struct common_approximately_equals_epsilon_multiplier { static T value() { + // The value is (a bit) arbitrary. For sort_by_side it should be large + // enough to not take a point which is too close by, to calculate the + // side value correctly. For get_cluster it is arbitrary as well, points + // close to each other should form a cluster, which is also important + // for subsequent side calculations. Points too far apart should not be + // clustered. + // + // The value of 100 is currently considered as a sweet spot. + // If the value changes (as of 2023-09-13): + // 10: too small, failing unit test(s): + // - union: issue_1108 + // 50: this would be fine, no tests failing + // 1000: this would be fine, no tests failing return T(100); } }; diff --git a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp index fb3ee1bef2..578ba090cf 100644 --- a/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/assign_parents.hpp @@ -362,7 +362,7 @@ inline void assign_parents(Geometry1 const& geometry1, } else if (info.parent.source_index >= 0) { - const ring_info_type& parent = ring_map[info.parent]; + ring_info_type const& parent = ring_map[info.parent]; bool const pos = math::larger(info.get_area(), 0); bool const parent_pos = math::larger(parent.area, 0); diff --git a/include/boost/geometry/algorithms/detail/overlay/colocate_clusters.hpp b/include/boost/geometry/algorithms/detail/overlay/colocate_clusters.hpp index 06d6e7bd61..6d04f0a098 100644 --- a/include/boost/geometry/algorithms/detail/overlay/colocate_clusters.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/colocate_clusters.hpp @@ -62,14 +62,14 @@ struct cluster_colocator { CoordinateType centroid_0 = 0; CoordinateType centroid_1 = 0; - for (const auto& index : indices) + for (auto const& index : indices) { centroid_0 += geometry::get<0>(turns[index].point); centroid_1 += geometry::get<1>(turns[index].point); } centroid_0 /= indices.size(); centroid_1 /= indices.size(); - for (const auto& index : indices) + for (auto const& index : indices) { geometry::set<0>(turns[index].point, centroid_0); geometry::set<1>(turns[index].point, centroid_1); @@ -86,14 +86,14 @@ inline void colocate_clusters(Clusters const& clusters, Turns& turns) { for (auto const& pair : clusters) { - auto const& indices = pair.second.turn_indices; - if (indices.size() < 2) + auto const& turn_indices = pair.second.turn_indices; + if (turn_indices.size() < 2) { // Defensive check continue; } - using point_t = decltype(turns[*indices.begin()].point); - cluster_colocator::apply(indices, turns); + using point_t = decltype(turns[*turn_indices.begin()].point); + cluster_colocator::apply(turn_indices, turns); } } diff --git a/include/boost/geometry/algorithms/detail/overlay/discard_duplicate_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/discard_duplicate_turns.hpp index 258a815f09..ca537e0815 100644 --- a/include/boost/geometry/algorithms/detail/overlay/discard_duplicate_turns.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/discard_duplicate_turns.hpp @@ -114,7 +114,7 @@ inline void discard_duplicate_start_turns(Turns& turns, { if (turn.method == method_start) { - for (const auto& op : turn.operations) + for (auto const& op : turn.operations) { start_turns_per_segment[adapt_id(op.seg_id)].push_back(index); } @@ -130,7 +130,7 @@ inline void discard_duplicate_start_turns(Turns& turns, // Also avoid comparing "start" with itself. if (turn.method != method_crosses && turn.method != method_start) { - for (const auto& op : turn.operations) + for (auto const& op : turn.operations) { auto it = start_turns_per_segment.find(adapt_id(op.seg_id)); if (it != start_turns_per_segment.end()) diff --git a/include/boost/geometry/algorithms/detail/overlay/get_clusters.hpp b/include/boost/geometry/algorithms/detail/overlay/get_clusters.hpp index e4969d658d..5d6badfd5c 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_clusters.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_clusters.hpp @@ -37,18 +37,22 @@ struct sweep_equal_policy { public: - // Returns true if point are considered equal (within an epsilon) + // Returns true if point are considered equal template static inline bool equals(P const& p1, P const& p2) { using coor_t = typename coordinate_type

::type; - return approximately_equals(p1, p2, common_approximately_equals_epsilon::value()); + static auto const tolerance + = common_approximately_equals_epsilon_multiplier::value(); + return approximately_equals(p1, p2, tolerance); } template static inline bool exceeds(T value) { - T const limit = T(1) / common_approximately_equals_epsilon::value(); + static auto const tolerance + = common_approximately_equals_epsilon_multiplier::value(); + T const limit = T(1) / tolerance; return value > limit; } }; diff --git a/include/boost/geometry/algorithms/detail/overlay/get_distance_measure.hpp b/include/boost/geometry/algorithms/detail/overlay/get_distance_measure.hpp index d462bb524d..81a9418a82 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_distance_measure.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_distance_measure.hpp @@ -78,7 +78,7 @@ struct get_distance_measure static result_type apply(SegmentPoint const& , SegmentPoint const& , Point const& ) { - const result_type result; + result_type const result; return result; } }; @@ -125,7 +125,7 @@ inline auto get_distance_measure(SegmentPoint const& p1, SegmentPoint const& p2, // Verify equality, without using a tolerance // (so don't use equals or equals_point_point) // because it is about very tiny differences. - auto identical = [](const auto& point1, const auto& point2) + auto identical = [](auto const& point1, auto const& point2) { return geometry::get<0>(point1) == geometry::get<0>(point2) && geometry::get<1>(point1) == geometry::get<1>(point2); 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 ee2b3f5351..0fa6bdbd1b 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -589,7 +589,7 @@ struct touch : public base_turn_handler // >----->P qj is LEFT of P1 and pi is LEFT of Q2 // (the other way round is also possible) - auto has_distance = [&](const auto& r1, const auto& r2) -> bool + auto has_distance = [&](auto const& r1, auto const& r2) -> bool { auto const d1 = get_distance_measure(r1.at(0), r1.at(1), r2.at(1), umbrella_strategy); auto const d2 = get_distance_measure(r2.at(1), r2.at(2), r1.at(0), umbrella_strategy); 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 76d7faf6de..90e4d0d063 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 @@ -696,7 +696,7 @@ struct get_turn_info_linear_areal namespace ov = overlay; typedef ov::get_turn_info_for_endpoint get_info_e; - const std::size_t ip_count = inters.i_info().count; + std::size_t const ip_count = inters.i_info().count; // no intersection points if (ip_count == 0) { diff --git a/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp b/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp index aaabb4a4df..b41697477d 100644 --- a/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp @@ -296,7 +296,7 @@ inline void assign_cluster_ids(Turns& turns, Clusters const& clusters) } for (auto const& kv : clusters) { - for (const auto& index : kv.second.turn_indices) + for (auto const& index : kv.second.turn_indices) { turns[index].cluster_id = kv.first; } diff --git a/include/boost/geometry/algorithms/detail/overlay/handle_self_turns.hpp b/include/boost/geometry/algorithms/detail/overlay/handle_self_turns.hpp index 435a80c272..3d7ea5eb32 100644 --- a/include/boost/geometry/algorithms/detail/overlay/handle_self_turns.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/handle_self_turns.hpp @@ -128,7 +128,7 @@ private : template static inline bool is_self_cluster(signed_size_type cluster_id, - const Turns& turns, Clusters const& clusters) + Turns const& turns, Clusters const& clusters) { auto cit = clusters.find(cluster_id); if (cit == clusters.end()) diff --git a/include/boost/geometry/algorithms/detail/overlay/sort_by_side.hpp b/include/boost/geometry/algorithms/detail/overlay/sort_by_side.hpp index 99449ed0c4..7e31a9fa9d 100644 --- a/include/boost/geometry/algorithms/detail/overlay/sort_by_side.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/sort_by_side.hpp @@ -89,7 +89,7 @@ struct ranked_point struct less_by_turn_index { template - inline bool operator()(const T& first, const T& second) const + inline bool operator()(T const& first, T const& second) const { return first.turn_index == second.turn_index ? first.index < second.index @@ -101,7 +101,7 @@ struct less_by_turn_index struct less_by_index { template - inline bool operator()(const T& first, const T& second) const + inline bool operator()(T const& first, T const& second) const { // Length might be considered too // First order by from/to @@ -123,7 +123,7 @@ struct less_by_index struct less_false { template - inline bool operator()(const T&, const T& ) const + inline bool operator()(T const&, T const& ) const { return false; } @@ -132,14 +132,14 @@ struct less_false template struct less_by_side { - less_by_side(const PointOrigin& p1, const PointTurn& p2, SideStrategy const& strategy) + less_by_side(PointOrigin const& p1, PointTurn const& p2, SideStrategy const& strategy) : m_origin(p1) , m_turn_point(p2) , m_strategy(strategy) {} template - inline bool operator()(const T& first, const T& second) const + inline bool operator()(T const& first, T const& second) const { typedef typename SideStrategy::cs_tag cs_tag; @@ -325,7 +325,8 @@ public : double >::type; - static auto const tolerance = common_approximately_equals_epsilon::value(); + static auto const tolerance + = common_approximately_equals_epsilon_multiplier::value(); int offset = 0; while (approximately_equals(point_from, turn.point, tolerance) @@ -417,7 +418,7 @@ public : for (std::size_t i = 0; i < m_ranked_points.size(); i++) { - const rp& ranked = m_ranked_points[i]; + rp const& ranked = m_ranked_points[i]; if (ranked.direction != dir_from) { continue; @@ -439,7 +440,7 @@ public : bool handled[2] = {false, false}; for (std::size_t i = 0; i < m_ranked_points.size(); i++) { - const rp& ranked = m_ranked_points[i]; + rp const& ranked = m_ranked_points[i]; if (ranked.direction != dir_from) { continue; diff --git a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp index 22ae1a2de8..0baf475a00 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal.hpp @@ -505,7 +505,7 @@ public : } inline - bool select_operation(const turn_type& turn, + bool select_operation(turn_type const& turn, signed_size_type turn_index, signed_size_type start_turn_index, segment_identifier const& previous_seg_id, @@ -536,7 +536,7 @@ public : return result; } - inline int starting_operation_index(const turn_type& turn) const + inline int starting_operation_index(turn_type const& turn) const { for (int i = 0; i < 2; i++) { @@ -548,7 +548,7 @@ public : return -1; } - inline bool both_finished(const turn_type& turn) const + inline bool both_finished(turn_type const& turn) const { for (int i = 0; i < 2; i++) { 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 a91345e533..a3aec363c0 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traversal_ring_creator.hpp @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -149,8 +150,8 @@ struct traversal_ring_creator { // Check operation (TODO: this might be redundant or should be catched before) - const turn_type& current_turn = m_turns[turn_index]; - const turn_operation_type& op = current_turn.operations[op_index]; + turn_type const& current_turn = m_turns[turn_index]; + turn_operation_type const& op = current_turn.operations[op_index]; if (op.visited.finalized() || m_trav.is_visited(current_turn, op, turn_index, op_index)) { diff --git a/include/boost/geometry/algorithms/detail/overlay/traverse.hpp b/include/boost/geometry/algorithms/detail/overlay/traverse.hpp index 710cea09e9..d56b6b1b2a 100644 --- a/include/boost/geometry/algorithms/detail/overlay/traverse.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/traverse.hpp @@ -11,6 +11,8 @@ #include +#include + #include #include #include diff --git a/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp b/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp index 0d95aabac1..91f4dac5b0 100644 --- a/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp +++ b/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp @@ -13,6 +13,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_BOUNDARY_CHECKER_HPP #include +#include #include #include diff --git a/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp b/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp index cb1f0f40c9..39d27da01e 100644 --- a/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp +++ b/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -98,7 +99,7 @@ struct for_each_disjoint_geometry_if { BOOST_GEOMETRY_ASSERT(first != last); - const std::size_t count = boost::size(geometry); + std::size_t const count = boost::size(geometry); // O(I) // gather info about turns generated for contained geometries @@ -229,8 +230,8 @@ class segment_watcher template class exit_watcher { - static const std::size_t op_id = OpId; - static const std::size_t other_op_id = (OpId + 1) % 2; + static std::size_t const op_id = OpId; + static std::size_t const other_op_id = (OpId + 1) % 2; typedef typename TurnInfo::point_type point_type; typedef detail::relate::point_info point_info; diff --git a/include/boost/geometry/algorithms/detail/relate/point_point.hpp b/include/boost/geometry/algorithms/detail/relate/point_point.hpp index c987bb44cb..9e8ccaca23 100644 --- a/include/boost/geometry/algorithms/detail/relate/point_point.hpp +++ b/include/boost/geometry/algorithms/detail/relate/point_point.hpp @@ -19,6 +19,7 @@ #include #include +#include #include #include diff --git a/include/boost/geometry/algorithms/detail/relate/topology_check.hpp b/include/boost/geometry/algorithms/detail/relate/topology_check.hpp index 2fc31ab51b..90f1ebd52f 100644 --- a/include/boost/geometry/algorithms/detail/relate/topology_check.hpp +++ b/include/boost/geometry/algorithms/detail/relate/topology_check.hpp @@ -12,6 +12,7 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_TOPOLOGY_CHECK_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_TOPOLOGY_CHECK_HPP +#include #include #include diff --git a/include/boost/geometry/algorithms/discrete_frechet_distance.hpp b/include/boost/geometry/algorithms/discrete_frechet_distance.hpp index 094ae14a3b..c84ec99b40 100644 --- a/include/boost/geometry/algorithms/discrete_frechet_distance.hpp +++ b/include/boost/geometry/algorithms/discrete_frechet_distance.hpp @@ -22,6 +22,8 @@ #include +#include + #include #include #include diff --git a/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp b/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp index 115909c06a..9e08c761ae 100644 --- a/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp +++ b/include/boost/geometry/algorithms/discrete_hausdorff_distance.hpp @@ -26,6 +26,8 @@ #include #include +#include + #include #include #include diff --git a/include/boost/geometry/algorithms/is_convex.hpp b/include/boost/geometry/algorithms/is_convex.hpp index afde6453f5..c5aef2ecbf 100644 --- a/include/boost/geometry/algorithms/is_convex.hpp +++ b/include/boost/geometry/algorithms/is_convex.hpp @@ -16,6 +16,7 @@ #include +#include #include #include diff --git a/include/boost/geometry/arithmetic/infinite_line_functions.hpp b/include/boost/geometry/arithmetic/infinite_line_functions.hpp index 529e83716b..16acb866c5 100644 --- a/include/boost/geometry/arithmetic/infinite_line_functions.hpp +++ b/include/boost/geometry/arithmetic/infinite_line_functions.hpp @@ -97,7 +97,7 @@ side_value(model::infinite_line const& line, Point const& p) } template -inline bool is_degenerate(const model::infinite_line& line) +inline bool is_degenerate(model::infinite_line const& line) { static Type const zero = 0; return math::equals(line.a, zero) && math::equals(line.b, zero); diff --git a/include/boost/geometry/index/detail/algorithms/path_intersection.hpp b/include/boost/geometry/index/detail/algorithms/path_intersection.hpp index 831efe5046..afa203e1e3 100644 --- a/include/boost/geometry/index/detail/algorithms/path_intersection.hpp +++ b/include/boost/geometry/index/detail/algorithms/path_intersection.hpp @@ -27,6 +27,10 @@ #include #include +#include +#include +#include +#include namespace boost { namespace geometry { namespace index { namespace detail { diff --git a/include/boost/geometry/io/dsv/write.hpp b/include/boost/geometry/io/dsv/write.hpp index 5870d21c58..e8b257a93a 100644 --- a/include/boost/geometry/io/dsv/write.hpp +++ b/include/boost/geometry/io/dsv/write.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/include/boost/geometry/policies/robustness/segment_ratio.hpp b/include/boost/geometry/policies/robustness/segment_ratio.hpp index 9a3914a756..5a75fad014 100644 --- a/include/boost/geometry/policies/robustness/segment_ratio.hpp +++ b/include/boost/geometry/policies/robustness/segment_ratio.hpp @@ -153,7 +153,7 @@ class segment_ratio , m_approximation(0) {} - inline segment_ratio(const Type& numerator, const Type& denominator) + inline segment_ratio(Type const& numerator, Type const& denominator) : m_numerator(numerator) , m_denominator(denominator) { @@ -207,7 +207,7 @@ class segment_ratio inline Type const& numerator() const { return m_numerator; } inline Type const& denominator() const { return m_denominator; } - inline void assign(const Type& numerator, const Type& denominator) + inline void assign(Type const& numerator, Type const& denominator) { m_numerator = numerator; m_denominator = denominator; diff --git a/include/boost/geometry/srs/projection.hpp b/include/boost/geometry/srs/projection.hpp index 9025952c0d..00e4523f79 100644 --- a/include/boost/geometry/srs/projection.hpp +++ b/include/boost/geometry/srs/projection.hpp @@ -19,6 +19,7 @@ #include #include +#include #include #include diff --git a/include/boost/geometry/srs/transformation.hpp b/include/boost/geometry/srs/transformation.hpp index d3c9b09c53..b327e11218 100644 --- a/include/boost/geometry/srs/transformation.hpp +++ b/include/boost/geometry/srs/transformation.hpp @@ -14,6 +14,7 @@ #include #include +#include #include #include diff --git a/include/boost/geometry/strategies/cartesian/side_rounded_input.hpp b/include/boost/geometry/strategies/cartesian/side_rounded_input.hpp index fc1543008f..9283a2b845 100644 --- a/include/boost/geometry/strategies/cartesian/side_rounded_input.hpp +++ b/include/boost/geometry/strategies/cartesian/side_rounded_input.hpp @@ -47,7 +47,7 @@ struct side_rounded_input coor_t const p_x = geometry::get<0>(p); coor_t const p_y = geometry::get<1>(p); - constexpr coor_t eps = std::numeric_limits::epsilon() / 2; + static coor_t const eps = std::numeric_limits::epsilon() / 2; coor_t const det = (p1_x - p_x) * (p2_y - p_y) - (p1_y - p_y) * (p2_x - p_x); coor_t const err_bound = (Coeff1 * eps + Coeff2 * eps * eps) * ( (geometry::math::abs(p1_x) + geometry::math::abs(p_x)) diff --git a/include/boost/geometry/strategy/spherical/envelope_range.hpp b/include/boost/geometry/strategy/spherical/envelope_range.hpp index 8833bd8ea3..e9f5ba2188 100644 --- a/include/boost/geometry/strategy/spherical/envelope_range.hpp +++ b/include/boost/geometry/strategy/spherical/envelope_range.hpp @@ -10,6 +10,8 @@ #ifndef BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_RANGE_HPP #define BOOST_GEOMETRY_STRATEGY_SPHERICAL_ENVELOPE_RANGE_HPP +#include + #include #include #include diff --git a/include/boost/geometry/util/math.hpp b/include/boost/geometry/util/math.hpp index c88572ed53..edd0f412c2 100644 --- a/include/boost/geometry/util/math.hpp +++ b/include/boost/geometry/util/math.hpp @@ -450,7 +450,7 @@ struct define_half_pi template struct relaxed_epsilon { - static inline T apply(const T& factor) + static inline T apply(T const& factor) { return factor * std::numeric_limits::epsilon(); } diff --git a/include/boost/geometry/views/detail/boundary_view/implementation.hpp b/include/boost/geometry/views/detail/boundary_view/implementation.hpp index 8a17b760ce..df9842d1f8 100644 --- a/include/boost/geometry/views/detail/boundary_view/implementation.hpp +++ b/include/boost/geometry/views/detail/boundary_view/implementation.hpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/index/test/algorithms/path_intersection.cpp b/index/test/algorithms/path_intersection.cpp index 66c76c4e1e..2c7e4df15c 100644 --- a/index/test/algorithms/path_intersection.cpp +++ b/index/test/algorithms/path_intersection.cpp @@ -17,7 +17,7 @@ #include #include -//#include +#include template void test_path_intersection(Box const& box, Linestring const& path, diff --git a/test/algorithms/envelope_expand/test_envelope.hpp b/test/algorithms/envelope_expand/test_envelope.hpp index 0873d81ba5..9ecd9eafb4 100644 --- a/test/algorithms/envelope_expand/test_envelope.hpp +++ b/test/algorithms/envelope_expand/test_envelope.hpp @@ -42,8 +42,8 @@ struct check_result ctype >; - static void apply(Box const& b, const type& x1, const type& y1, const type& /*z1*/, - const type& x2, const type& y2, const type& /*z2*/) + static void apply(Box const& b, type const& x1, type const& y1, type const& /*z1*/, + type const& x2, type const& y2, type const& /*z2*/) { BOOST_CHECK_CLOSE((bg::get(b)), x1, 0.001); BOOST_CHECK_CLOSE((bg::get(b)), y1, 0.001); @@ -64,8 +64,8 @@ struct check_result ctype >; - static void apply(Box const& b, const type& x1, const type& y1, const type& z1, - const type& x2, const type& y2, const type& z2) + static void apply(Box const& b, type const& x1, type const& y1, type const& z1, + type const& x2, type const& y2, type const& z2) { BOOST_CHECK_CLOSE((bg::get(b)), x1, 0.001); BOOST_CHECK_CLOSE((bg::get(b)), y1, 0.001); @@ -80,9 +80,9 @@ struct check_result template void test_envelope(std::string const& wkt, - const T& x1, const T& x2, - const T& y1, const T& y2, - const T& z1 = 0, const T& z2 = 0) + T const& x1, T const& x2, + T const& y1, T const& y2, + T const& z1 = 0, T const& z2 = 0) { typedef bg::model::box::type > box_type; box_type b; diff --git a/test/algorithms/overlay/overlay_cases.hpp b/test/algorithms/overlay/overlay_cases.hpp index 4d654eb0c0..48ebfcde11 100644 --- a/test/algorithms/overlay/overlay_cases.hpp +++ b/test/algorithms/overlay/overlay_cases.hpp @@ -1113,6 +1113,12 @@ static std::string issue_1108[2] = "POLYGON((22 1,22 0,14 0,18 -1.2696790939262529996,12 0,22 1))" }; +static std::string issue_1138[2] = +{ + "POLYGON((2000.0 0.0, 2000.0 1500.0, 2041.0688999999999851 1500.0, 2041.0688999999999851 1471.3408999999999196, 2101.0889000000001943 1471.3408999999999196, 2101.0889000000001943 1500.0 2333.7840000000001055 1500.0 2333.7840000000001055 1471.9327000000000680, 2334.3757000000000517 1471.3409999999998945, 2335.2123000000001412 1471.3409999999998945, 2335.8040000000000873 1471.9327000000000680, 2335.8040000000000873 1500.0 2589.9909999999999854 1500.0 2589.9909999999999854 1471.9327000000000680, 2590.3476000000000568 1471.5760999999999967, 2533.8917000000001281 1471.5760999999999967, 2533.8917000000001281 1242.4249999999999545, 2326.7667000000001281 1242.4249999999999545, 2326.7667000000001281 1245.8577000000000226, 2325.5118999999999687 1246.1938999999999851, 2324.6006999999999607 1247.1051999999999680, 2324.2644000000000233 1248.3599999999999000, 2323.7667000000001281 1248.3599999999999000, 2323.7667000000001281 1269.3599999999999000, 2288.7467000000001462 1269.3599999999999000, 2288.7467000000001462 1248.3599999999999000, 2286.7489999999997963 1248.3599999999999000, 2286.4798000000000684 1247.3551999999999680, 2285.7514999999998508 1246.6268999999999778, 2284.7467000000001462 1246.3577000000000226, 2284.7467000000001462 1242.4249999999999545, 2099.4816999999998188 1242.4249999999999545, 2099.4816999999998188 0.0 2000.0 0.0000000000000000))", + "POLYGON((3000.0 0.0,2099.4817 0,2099.4817 1242.425,2316.6867 1242.425,2316.6867 1471.576,2334.1407 1471.576,2333.784 1471.9327,2333.784 1500.0,3000.0 1500.0,3000.0 0.0))" +}; + static std::string issue_1183[2] = { "POLYGON((\ diff --git a/test/algorithms/set_operations/difference/difference.cpp b/test/algorithms/set_operations/difference/difference.cpp index fb38427199..1c36b8f650 100644 --- a/test/algorithms/set_operations/difference/difference.cpp +++ b/test/algorithms/set_operations/difference/difference.cpp @@ -583,6 +583,8 @@ void test_all() #endif TEST_DIFFERENCE(issue_876b, 1, 6114.18234, 1, 4754.29449, count_set(1, 2)); + TEST_DIFFERENCE(issue_1138, 1, 203161.751, 2, 1237551.0171, 1); + TEST_DIFFERENCE(mysql_21977775, 2, 160.856568913, 2, 92.3565689126, 4); TEST_DIFFERENCE(mysql_21965285, 1, 92.0, 1, 14.0, 1); TEST_DIFFERENCE(mysql_23023665_1, 1, 92.0, 1, 142.5, 2); diff --git a/test/algorithms/set_operations/difference/test_difference.hpp b/test/algorithms/set_operations/difference/test_difference.hpp index fb6dfe9a79..d9e13a210d 100644 --- a/test/algorithms/set_operations/difference/test_difference.hpp +++ b/test/algorithms/set_operations/difference/test_difference.hpp @@ -159,7 +159,7 @@ void difference_output(std::string const& caseid, G1 const& g1, G2 const& g2, Ou template std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, - const count_set& expected_count, + count_set const& expected_count, int expected_rings_count, int expected_point_count, expectation_limits const& expected_area, difference_type dtype, @@ -305,7 +305,7 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g template std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, - const count_set& expected_count, int expected_point_count, + count_set const& expected_count, int expected_point_count, expectation_limits const& expected_area, difference_type dtype, ut_settings const& settings) @@ -323,15 +323,15 @@ static int counter = 0; template std::string test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2, - const count_set& expected_count1, + count_set const& expected_count1, int expected_rings_count1, int expected_point_count1, expectation_limits const& expected_area1, - const count_set& expected_count2, + count_set const& expected_count2, int expected_rings_count2, int expected_point_count2, expectation_limits const& expected_area2, - const count_set& expected_count_s, + count_set const& expected_count_s, int expected_rings_count_s, int expected_point_count_s, expectation_limits const& expected_area_s, @@ -382,11 +382,11 @@ std::string test_one(std::string const& caseid, template std::string test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2, - const count_set& expected_count1, + count_set const& expected_count1, int expected_rings_count1, int expected_point_count1, expectation_limits const& expected_area1, - const count_set& expected_count2, + count_set const& expected_count2, int expected_rings_count2, int expected_point_count2, expectation_limits const& expected_area2, @@ -407,13 +407,13 @@ std::string test_one(std::string const& caseid, template std::string test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2, - const count_set& expected_count1, + count_set const& expected_count1, int expected_point_count1, expectation_limits const& expected_area1, - const count_set& expected_count2, + count_set const& expected_count2, int expected_point_count2, expectation_limits const& expected_area2, - const count_set& expected_count_s, + count_set const& expected_count_s, int expected_point_count_s, expectation_limits const& expected_area_s, ut_settings const& settings = ut_settings()) @@ -429,13 +429,13 @@ std::string test_one(std::string const& caseid, template std::string test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2, - const count_set& expected_count1, + count_set const& expected_count1, int expected_point_count1, expectation_limits const& expected_area1, - const count_set& expected_count2, + count_set const& expected_count2, int expected_point_count2, expectation_limits const& expected_area2, - const count_set& expected_count_s, + count_set const& expected_count_s, ut_settings const& settings = ut_settings()) { return test_one(caseid, wkt1, wkt2, @@ -452,10 +452,10 @@ std::string test_one(std::string const& caseid, template std::string test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2, - const count_set& expected_count1, + count_set const& expected_count1, int expected_point_count1, expectation_limits const& expected_area1, - const count_set& expected_count2, + count_set const& expected_count2, int expected_point_count2, expectation_limits const& expected_area2, ut_settings const& settings = ut_settings()) diff --git a/test/algorithms/set_operations/intersection/test_intersection.hpp b/test/algorithms/set_operations/intersection/test_intersection.hpp index 8c448a10c6..1712670ac6 100644 --- a/test/algorithms/set_operations/intersection/test_intersection.hpp +++ b/test/algorithms/set_operations/intersection/test_intersection.hpp @@ -67,7 +67,7 @@ template void check_result(IntersectionOutput const& intersection_output, std::string const& caseid, G1 const& g1, G2 const& g2, - const count_set& expected_count, const count_set& expected_hole_count, + count_set const& expected_count, count_set const& expected_hole_count, int expected_point_count, expectation_limits const& expected_length_or_area, ut_settings const& settings) { @@ -165,8 +165,8 @@ void check_result(IntersectionOutput const& intersection_output, template typename bg::default_area_result::type test_intersection(std::string const& caseid, G1 const& g1, G2 const& g2, - const count_set& expected_count = count_set(), - const count_set& expected_hole_count = count_set(), + count_set const& expected_count = count_set(), + count_set const& expected_hole_count = count_set(), int expected_point_count = 0, expectation_limits const& expected_length_or_area = 0, ut_settings const& settings = ut_settings()) { @@ -289,7 +289,7 @@ typename bg::default_area_result::type test_intersection(std::string const& template typename bg::default_area_result::type test_intersection(std::string const& caseid, G1 const& g1, G2 const& g2, - const count_set& expected_count = count_set(), int expected_point_count = 0, + count_set const& expected_count = count_set(), int expected_point_count = 0, expectation_limits const& expected_length_or_area = 0, ut_settings const& settings = ut_settings()) { @@ -303,8 +303,8 @@ typename bg::default_area_result::type test_intersection(std::string const& template typename bg::default_area_result::type test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2, - const count_set& expected_count, - const count_set& expected_hole_count, + count_set const& expected_count, + count_set const& expected_hole_count, int expected_point_count, expectation_limits const& expected_length_or_area, ut_settings const& settings = ut_settings()) @@ -328,7 +328,7 @@ typename bg::default_area_result::type test_one(std::string const& caseid, template typename bg::default_area_result::type test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2, - const count_set& expected_count, + count_set const& expected_count, int expected_point_count, expectation_limits const& expected_length_or_area, ut_settings const& settings = ut_settings()) @@ -342,7 +342,7 @@ typename bg::default_area_result::type test_one(std::string const& caseid, template void test_one_lp(std::string const& caseid, std::string const& wkt_areal, std::string const& wkt_linear, - const count_set& expected_count = count_set(), int expected_point_count = 0, + count_set const& expected_count = count_set(), int expected_point_count = 0, expectation_limits const& expected_length = 0, ut_settings const& settings = ut_settings()) { diff --git a/test/algorithms/set_operations/union/Jamfile b/test/algorithms/set_operations/union/Jamfile index d3f54ac923..6cd0159c03 100644 --- a/test/algorithms/set_operations/union/Jamfile +++ b/test/algorithms/set_operations/union/Jamfile @@ -25,6 +25,7 @@ test-suite boost-geometry-algorithms-union [ run union_gc.cpp : : : : algorithms_union_gc ] [ run union_linear_linear.cpp : : : : algorithms_union_linear_linear ] [ run union_pl_pl.cpp : : : : algorithms_union_pl_pl ] + [ run union_issues.cpp : : : : algorithms_union_issues ] [ run union_tupled.cpp : : : : algorithms_union_tupled ] [ run union_other_types.cpp : : : BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE : algorithms_union_other_types ] ; diff --git a/test/algorithms/set_operations/union/test_union.hpp b/test/algorithms/set_operations/union/test_union.hpp index 1946e3df76..2f6957bee1 100644 --- a/test/algorithms/set_operations/union/test_union.hpp +++ b/test/algorithms/set_operations/union/test_union.hpp @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -68,7 +69,7 @@ inline std::size_t num_points(Range const& rng, bool add_for_open = false) template void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, - const count_set& expected_count, const count_set& expected_hole_count, + count_set const& expected_count, count_set const& expected_hole_count, int expected_point_count, expectation_limits const& expected_area, ut_settings const& settings) { @@ -240,7 +241,7 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, template void test_one(std::string const& caseid, std::string const& wkt1, std::string const& wkt2, - const count_set& expected_count, const count_set& expected_hole_count, + count_set const& expected_count, count_set const& expected_hole_count, int expected_point_count, expectation_limits const& expected_area, ut_settings const& settings = ut_settings()) { diff --git a/test/algorithms/set_operations/union/union_issues.cpp b/test/algorithms/set_operations/union/union_issues.cpp new file mode 100644 index 0000000000..b09ccc8743 --- /dev/null +++ b/test/algorithms/set_operations/union/union_issues.cpp @@ -0,0 +1,56 @@ +// Boost.Geometry + +// Unit Test + +// Copyright (c) 2023 Barend Gehrels, Amsterdam, the Netherlands. + +// Use, modification and distribution is subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// This unit test is verifying some issues which do not use WKT, +// or are not expressable as WKT (for example by the use of an epsilon) + +#include + +#include +#include +#include + +#include + +template +void issue_1103() +{ + using point_t = bg::model::d2::point_xy; + using polygon_t = bg::model::polygon; + + polygon_t poly1; + bg::append(poly1, point_t(1, 1)); + bg::append(poly1, point_t(1, std::numeric_limits::epsilon())); + bg::append(poly1, point_t(0, std::numeric_limits::epsilon())); + bg::append(poly1, point_t(0, 1)); + bg::append(poly1, point_t(1, 1)); + + polygon_t poly2; + bg::append(poly2, point_t(1, 0)); + bg::append(poly2, point_t(1, -1)); + bg::append(poly2, point_t(0, -1)); + bg::append(poly2, point_t(0, 0)); + bg::append(poly2, point_t(1, 0)); + + bg::model::multi_polygon result; + bg::union_(poly1, poly2, result); + + // Verify result. Before commit b1bebca the result was empty. + BOOST_CHECK_EQUAL(1, boost::size(result)); + BOOST_CHECK_CLOSE(2.0, bg::area(result), 0.0001); +} + +int test_main(int, char* []) +{ + issue_1103(); + issue_1103(); + + return 0; +} diff --git a/test/concepts/function_asserting_a_point.hpp b/test/concepts/function_asserting_a_point.hpp index 802d198527..3e67b89e0b 100644 --- a/test/concepts/function_asserting_a_point.hpp +++ b/test/concepts/function_asserting_a_point.hpp @@ -18,7 +18,7 @@ namespace bg = boost::geometry; namespace test { template - void function_asserting_a_point(P& p1, const CP& p2) + void function_asserting_a_point(P& p1, CP const& p2) { BOOST_CONCEPT_ASSERT((bg::concepts::Point

)); BOOST_CONCEPT_ASSERT((bg::concepts::ConstPoint

)); diff --git a/test/concepts/function_requiring_a_point.hpp b/test/concepts/function_requiring_a_point.hpp index d8628e940e..6af0991bb5 100644 --- a/test/concepts/function_requiring_a_point.hpp +++ b/test/concepts/function_requiring_a_point.hpp @@ -17,7 +17,7 @@ namespace bg = boost::geometry; namespace test { template - inline void function_requiring_a_point(P& p1, const C& p2) + inline void function_requiring_a_point(P& p1, C const& p2) { BOOST_CONCEPT_ASSERT((bg::concepts::Point

)); BOOST_CONCEPT_ASSERT((bg::concepts::ConstPoint)); diff --git a/test/count_set.hpp b/test/count_set.hpp index 3ac900616c..83e985a4be 100644 --- a/test/count_set.hpp +++ b/test/count_set.hpp @@ -49,7 +49,7 @@ struct count_set return m_values.count(value) > 0; } - friend std::ostream &operator<<(std::ostream &os, const count_set& s) + friend std::ostream &operator<<(std::ostream &os, count_set const& s) { os << "{"; for (std::size_t const& value : s.m_values) @@ -60,7 +60,7 @@ struct count_set return os; } - count_set operator+(const count_set& a) const + count_set operator+(count_set const& a) const { count_set result; result.m_values = combine(this->m_values, a.m_values); @@ -71,7 +71,7 @@ private : typedef std::set set_type; set_type m_values; - set_type combine(const set_type& a, const set_type& b) const + set_type combine(const set_type& a, set_type const& b) const { set_type result; if (a.size() == 1 && b.size() == 1) diff --git a/test/expectation_limits.hpp b/test/expectation_limits.hpp index ba7585803d..bbb5c1462e 100644 --- a/test/expectation_limits.hpp +++ b/test/expectation_limits.hpp @@ -42,7 +42,7 @@ struct expectation_limits bool has_two_limits() const { return m_lower_limit < m_upper_limit; } template - bool contains_logarithmic(const T& value, double tolerance) const + bool contains_logarithmic(T const& value, double tolerance) const { using std::abs; using std::log; @@ -50,7 +50,7 @@ struct expectation_limits } template - bool contains(const T& value, double percentage, bool logarithmic = false) const + bool contains(T const& value, double percentage, bool logarithmic = false) const { if (m_upper_limit < 1.0e-8) { @@ -80,7 +80,7 @@ struct expectation_limits : expectation_limits(this->m_lower_limit + a.m_lower_limit); } - friend std::ostream &operator<<(std::ostream &os, const expectation_limits& lim) + friend std::ostream &operator<<(std::ostream &os, expectation_limits const& lim) { if (lim.has_two_limits()) { diff --git a/test/geometries/custom_non_copiable/helper_functions.hpp b/test/geometries/custom_non_copiable/helper_functions.hpp index 489e5c45f0..563baf2b52 100644 --- a/test/geometries/custom_non_copiable/helper_functions.hpp +++ b/test/geometries/custom_non_copiable/helper_functions.hpp @@ -17,7 +17,7 @@ #include template -void fill(Ring& ring, const std::vector::type>& v) +void fill(Ring& ring, std::vector::type> const& v) { ring.custom_clear(); for(auto const& p : v) diff --git a/test/test_common/test_point.hpp b/test/test_common/test_point.hpp index 3f888a2f55..42a0f11b40 100644 --- a/test/test_common/test_point.hpp +++ b/test/test_common/test_point.hpp @@ -74,7 +74,7 @@ template<> struct access return p.c1; } - static inline void set(test::test_point& p, const float& value) + static inline void set(test::test_point& p, float const& value) { p.c1 = value; } @@ -87,7 +87,7 @@ template<> struct access return p.c2; } - static inline void set(test::test_point& p, const float& value) + static inline void set(test::test_point& p, float const& value) { p.c2 = value; } @@ -100,7 +100,7 @@ template<> struct access return p.c3; } - static inline void set(test::test_point& p, const float& value) + static inline void set(test::test_point& p, float const& value) { p.c3 = value; }