placement of const

This commit is contained in:
Barend Gehrels 2023-09-14 13:20:15 +02:00
parent 5eb6209162
commit 96ba473fa4
28 changed files with 77 additions and 77 deletions

View File

@ -216,7 +216,7 @@ template <typename Geometry1, typename Geometry2>
struct assign struct assign
{ {
static inline void static inline void
apply(Geometry1& geometry1, const Geometry2& geometry2) apply(Geometry1& geometry1, Geometry2 const& geometry2)
{ {
concepts::check<Geometry1>(); concepts::check<Geometry1>();
concepts::check<Geometry2 const>(); concepts::check<Geometry2 const>();

View File

@ -698,7 +698,7 @@ struct buffered_piece_collection
BOOST_GEOMETRY_ASSERT(pc.offsetted_count >= 0); 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) if (add_to_original && pc.type != strategy::buffer::buffered_concave)
{ {

View File

@ -100,7 +100,7 @@ inline void append_no_dups_or_spikes(Range& range, Point const& point,
return; return;
} }
auto append = [](auto& r, const auto& p) auto append = [](auto& r, auto const& p)
{ {
using point_t = typename boost::range_value<Range>::type; using point_t = typename boost::range_value<Range>::type;
point_t rp; point_t rp;

View File

@ -362,7 +362,7 @@ inline void assign_parents(Geometry1 const& geometry1,
} }
else if (info.parent.source_index >= 0) 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 pos = math::larger(info.get_area(), 0);
bool const parent_pos = math::larger(parent.area, 0); bool const parent_pos = math::larger(parent.area, 0);

View File

@ -62,14 +62,14 @@ struct cluster_colocator<Point, CoordinateType, geometry::cartesian_tag, false>
{ {
CoordinateType centroid_0 = 0; CoordinateType centroid_0 = 0;
CoordinateType centroid_1 = 0; CoordinateType centroid_1 = 0;
for (const auto& index : indices) for (auto const& index : indices)
{ {
centroid_0 += geometry::get<0>(turns[index].point); centroid_0 += geometry::get<0>(turns[index].point);
centroid_1 += geometry::get<1>(turns[index].point); centroid_1 += geometry::get<1>(turns[index].point);
} }
centroid_0 /= indices.size(); centroid_0 /= indices.size();
centroid_1 /= 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<0>(turns[index].point, centroid_0);
geometry::set<1>(turns[index].point, centroid_1); geometry::set<1>(turns[index].point, centroid_1);

View File

@ -114,7 +114,7 @@ inline void discard_duplicate_start_turns(Turns& turns,
{ {
if (turn.method == method_start) 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); 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. // Also avoid comparing "start" with itself.
if (turn.method != method_crosses && turn.method != method_start) 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)); auto it = start_turns_per_segment.find(adapt_id(op.seg_id));
if (it != start_turns_per_segment.end()) if (it != start_turns_per_segment.end())

View File

@ -78,7 +78,7 @@ struct get_distance_measure<CalculationType, spherical_tag>
static result_type apply(SegmentPoint const& , SegmentPoint const& , static result_type apply(SegmentPoint const& , SegmentPoint const& ,
Point const& ) Point const& )
{ {
const result_type result; result_type const result;
return result; return result;
} }
}; };
@ -125,7 +125,7 @@ inline auto get_distance_measure(SegmentPoint const& p1, SegmentPoint const& p2,
// Verify equality, without using a tolerance // Verify equality, without using a tolerance
// (so don't use equals or equals_point_point) // (so don't use equals or equals_point_point)
// because it is about very tiny differences. // 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) return geometry::get<0>(point1) == geometry::get<0>(point2)
&& geometry::get<1>(point1) == geometry::get<1>(point2); && geometry::get<1>(point1) == geometry::get<1>(point2);

View File

@ -589,7 +589,7 @@ struct touch : public base_turn_handler
// >----->P qj is LEFT of P1 and pi is LEFT of Q2 // >----->P qj is LEFT of P1 and pi is LEFT of Q2
// (the other way round is also possible) // (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 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); auto const d2 = get_distance_measure(r2.at(1), r2.at(2), r1.at(0), umbrella_strategy);

View File

@ -696,7 +696,7 @@ struct get_turn_info_linear_areal
namespace ov = overlay; namespace ov = overlay;
typedef ov::get_turn_info_for_endpoint<EnableFirst, EnableLast> get_info_e; typedef ov::get_turn_info_for_endpoint<EnableFirst, EnableLast> 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 // no intersection points
if (ip_count == 0) if (ip_count == 0)
{ {

View File

@ -296,7 +296,7 @@ inline void assign_cluster_ids(Turns& turns, Clusters const& clusters)
} }
for (auto const& kv : 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; turns[index].cluster_id = kv.first;
} }

View File

@ -128,7 +128,7 @@ private :
template <typename Turns, typename Clusters> template <typename Turns, typename Clusters>
static inline static inline
bool is_self_cluster(signed_size_type cluster_id, 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); auto cit = clusters.find(cluster_id);
if (cit == clusters.end()) if (cit == clusters.end())

View File

@ -89,7 +89,7 @@ struct ranked_point
struct less_by_turn_index struct less_by_turn_index
{ {
template <typename T> template <typename T>
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 return first.turn_index == second.turn_index
? first.index < second.index ? first.index < second.index
@ -101,7 +101,7 @@ struct less_by_turn_index
struct less_by_index struct less_by_index
{ {
template <typename T> template <typename T>
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 // Length might be considered too
// First order by from/to // First order by from/to
@ -123,7 +123,7 @@ struct less_by_index
struct less_false struct less_false
{ {
template <typename T> template <typename T>
inline bool operator()(const T&, const T& ) const inline bool operator()(T const&, T const& ) const
{ {
return false; return false;
} }
@ -132,14 +132,14 @@ struct less_false
template <typename PointOrigin, typename PointTurn, typename SideStrategy, typename LessOnSame, typename Compare> template <typename PointOrigin, typename PointTurn, typename SideStrategy, typename LessOnSame, typename Compare>
struct less_by_side 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_origin(p1)
, m_turn_point(p2) , m_turn_point(p2)
, m_strategy(strategy) , m_strategy(strategy)
{} {}
template <typename T> template <typename T>
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; typedef typename SideStrategy::cs_tag cs_tag;
@ -418,7 +418,7 @@ public :
for (std::size_t i = 0; i < m_ranked_points.size(); i++) 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) if (ranked.direction != dir_from)
{ {
continue; continue;
@ -440,7 +440,7 @@ public :
bool handled[2] = {false, false}; bool handled[2] = {false, false};
for (std::size_t i = 0; i < m_ranked_points.size(); i++) 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) if (ranked.direction != dir_from)
{ {
continue; continue;

View File

@ -505,7 +505,7 @@ public :
} }
inline inline
bool select_operation(const turn_type& turn, bool select_operation(turn_type const& turn,
signed_size_type turn_index, signed_size_type turn_index,
signed_size_type start_turn_index, signed_size_type start_turn_index,
segment_identifier const& previous_seg_id, segment_identifier const& previous_seg_id,
@ -536,7 +536,7 @@ public :
return result; 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++) for (int i = 0; i < 2; i++)
{ {
@ -548,7 +548,7 @@ public :
return -1; 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++) for (int i = 0; i < 2; i++)
{ {

View File

@ -149,8 +149,8 @@ struct traversal_ring_creator
{ {
// Check operation (TODO: this might be redundant or should be catched before) // Check operation (TODO: this might be redundant or should be catched before)
const turn_type& current_turn = m_turns[turn_index]; turn_type const& current_turn = m_turns[turn_index];
const turn_operation_type& op = current_turn.operations[op_index]; turn_operation_type const& op = current_turn.operations[op_index];
if (op.visited.finalized() if (op.visited.finalized()
|| m_trav.is_visited(current_turn, op, turn_index, op_index)) || m_trav.is_visited(current_turn, op, turn_index, op_index))
{ {

View File

@ -98,7 +98,7 @@ struct for_each_disjoint_geometry_if<OpId, Geometry, Tag, true>
{ {
BOOST_GEOMETRY_ASSERT(first != last); BOOST_GEOMETRY_ASSERT(first != last);
const std::size_t count = boost::size(geometry); std::size_t const count = boost::size(geometry);
// O(I) // O(I)
// gather info about turns generated for contained geometries // gather info about turns generated for contained geometries
@ -229,8 +229,8 @@ private:
template <typename TurnInfo, std::size_t OpId> template <typename TurnInfo, std::size_t OpId>
class exit_watcher class exit_watcher
{ {
static const std::size_t op_id = OpId; static std::size_t const op_id = OpId;
static const std::size_t other_op_id = (OpId + 1) % 2; static std::size_t const other_op_id = (OpId + 1) % 2;
typedef typename TurnInfo::point_type point_type; typedef typename TurnInfo::point_type point_type;
typedef detail::relate::point_info<point_type> point_info; typedef detail::relate::point_info<point_type> point_info;

View File

@ -97,7 +97,7 @@ side_value(model::infinite_line<Type> const& line, Point const& p)
} }
template <typename Type> template <typename Type>
inline bool is_degenerate(const model::infinite_line<Type>& line) inline bool is_degenerate(model::infinite_line<Type> const& line)
{ {
static Type const zero = 0; static Type const zero = 0;
return math::equals(line.a, zero) && math::equals(line.b, zero); return math::equals(line.a, zero) && math::equals(line.b, zero);

View File

@ -153,7 +153,7 @@ public:
, m_approximation(0) , 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_numerator(numerator)
, m_denominator(denominator) , m_denominator(denominator)
{ {
@ -207,7 +207,7 @@ public:
inline Type const& numerator() const { return m_numerator; } inline Type const& numerator() const { return m_numerator; }
inline Type const& denominator() const { return m_denominator; } 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_numerator = numerator;
m_denominator = denominator; m_denominator = denominator;

View File

@ -450,7 +450,7 @@ struct define_half_pi
template <typename T> template <typename T>
struct relaxed_epsilon struct relaxed_epsilon
{ {
static inline T apply(const T& factor) static inline T apply(T const& factor)
{ {
return factor * std::numeric_limits<T>::epsilon(); return factor * std::numeric_limits<T>::epsilon();
} }

View File

@ -42,8 +42,8 @@ struct check_result<Box, 2>
ctype ctype
>; >;
static void apply(Box const& b, const type& x1, const type& y1, const type& /*z1*/, static void apply(Box const& b, type const& x1, type const& y1, type const& /*z1*/,
const type& x2, const type& y2, const type& /*z2*/) type const& x2, type const& y2, type const& /*z2*/)
{ {
BOOST_CHECK_CLOSE((bg::get<bg::min_corner, 0>(b)), x1, 0.001); BOOST_CHECK_CLOSE((bg::get<bg::min_corner, 0>(b)), x1, 0.001);
BOOST_CHECK_CLOSE((bg::get<bg::min_corner, 1>(b)), y1, 0.001); BOOST_CHECK_CLOSE((bg::get<bg::min_corner, 1>(b)), y1, 0.001);
@ -64,8 +64,8 @@ struct check_result<Box, 3>
ctype ctype
>; >;
static void apply(Box const& b, const type& x1, const type& y1, const type& z1, static void apply(Box const& b, type const& x1, type const& y1, type const& z1,
const type& x2, const type& y2, const type& z2) type const& x2, type const& y2, type const& z2)
{ {
BOOST_CHECK_CLOSE((bg::get<bg::min_corner, 0>(b)), x1, 0.001); BOOST_CHECK_CLOSE((bg::get<bg::min_corner, 0>(b)), x1, 0.001);
BOOST_CHECK_CLOSE((bg::get<bg::min_corner, 1>(b)), y1, 0.001); BOOST_CHECK_CLOSE((bg::get<bg::min_corner, 1>(b)), y1, 0.001);
@ -80,9 +80,9 @@ struct check_result<Box, 3>
template <typename Geometry, typename T> template <typename Geometry, typename T>
void test_envelope(std::string const& wkt, void test_envelope(std::string const& wkt,
const T& x1, const T& x2, T const& x1, T const& x2,
const T& y1, const T& y2, T const& y1, T const& y2,
const T& z1 = 0, const T& z2 = 0) T const& z1 = 0, T const& z2 = 0)
{ {
typedef bg::model::box<typename bg::point_type<Geometry>::type > box_type; typedef bg::model::box<typename bg::point_type<Geometry>::type > box_type;
box_type b; box_type b;

View File

@ -159,7 +159,7 @@ void difference_output(std::string const& caseid, G1 const& g1, G2 const& g2, Ou
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, 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, int expected_rings_count, int expected_point_count,
expectation_limits const& expected_area, expectation_limits const& expected_area,
difference_type dtype, difference_type dtype,
@ -305,7 +305,7 @@ std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
std::string test_difference(std::string const& caseid, G1 const& g1, G2 const& g2, 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, expectation_limits const& expected_area,
difference_type dtype, difference_type dtype,
ut_settings const& settings) ut_settings const& settings)
@ -323,15 +323,15 @@ static int counter = 0;
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
std::string test_one(std::string const& caseid, std::string test_one(std::string const& caseid,
std::string const& wkt1, std::string const& wkt2, std::string const& wkt1, std::string const& wkt2,
const count_set& expected_count1, count_set const& expected_count1,
int expected_rings_count1, int expected_rings_count1,
int expected_point_count1, int expected_point_count1,
expectation_limits const& expected_area1, expectation_limits const& expected_area1,
const count_set& expected_count2, count_set const& expected_count2,
int expected_rings_count2, int expected_rings_count2,
int expected_point_count2, int expected_point_count2,
expectation_limits const& expected_area2, expectation_limits const& expected_area2,
const count_set& expected_count_s, count_set const& expected_count_s,
int expected_rings_count_s, int expected_rings_count_s,
int expected_point_count_s, int expected_point_count_s,
expectation_limits const& expected_area_s, expectation_limits const& expected_area_s,
@ -382,11 +382,11 @@ std::string test_one(std::string const& caseid,
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
std::string test_one(std::string const& caseid, std::string test_one(std::string const& caseid,
std::string const& wkt1, std::string const& wkt2, std::string const& wkt1, std::string const& wkt2,
const count_set& expected_count1, count_set const& expected_count1,
int expected_rings_count1, int expected_rings_count1,
int expected_point_count1, int expected_point_count1,
expectation_limits const& expected_area1, expectation_limits const& expected_area1,
const count_set& expected_count2, count_set const& expected_count2,
int expected_rings_count2, int expected_rings_count2,
int expected_point_count2, int expected_point_count2,
expectation_limits const& expected_area2, expectation_limits const& expected_area2,
@ -407,13 +407,13 @@ std::string test_one(std::string const& caseid,
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
std::string test_one(std::string const& caseid, std::string test_one(std::string const& caseid,
std::string const& wkt1, std::string const& wkt2, std::string const& wkt1, std::string const& wkt2,
const count_set& expected_count1, count_set const& expected_count1,
int expected_point_count1, int expected_point_count1,
expectation_limits const& expected_area1, expectation_limits const& expected_area1,
const count_set& expected_count2, count_set const& expected_count2,
int expected_point_count2, int expected_point_count2,
expectation_limits const& expected_area2, expectation_limits const& expected_area2,
const count_set& expected_count_s, count_set const& expected_count_s,
int expected_point_count_s, int expected_point_count_s,
expectation_limits const& expected_area_s, expectation_limits const& expected_area_s,
ut_settings const& settings = ut_settings()) ut_settings const& settings = ut_settings())
@ -429,13 +429,13 @@ std::string test_one(std::string const& caseid,
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
std::string test_one(std::string const& caseid, std::string test_one(std::string const& caseid,
std::string const& wkt1, std::string const& wkt2, std::string const& wkt1, std::string const& wkt2,
const count_set& expected_count1, count_set const& expected_count1,
int expected_point_count1, int expected_point_count1,
expectation_limits const& expected_area1, expectation_limits const& expected_area1,
const count_set& expected_count2, count_set const& expected_count2,
int expected_point_count2, int expected_point_count2,
expectation_limits const& expected_area2, expectation_limits const& expected_area2,
const count_set& expected_count_s, count_set const& expected_count_s,
ut_settings const& settings = ut_settings()) ut_settings const& settings = ut_settings())
{ {
return test_one<OutputType, G1, G2>(caseid, wkt1, wkt2, return test_one<OutputType, G1, G2>(caseid, wkt1, wkt2,
@ -452,10 +452,10 @@ std::string test_one(std::string const& caseid,
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
std::string test_one(std::string const& caseid, std::string test_one(std::string const& caseid,
std::string const& wkt1, std::string const& wkt2, std::string const& wkt1, std::string const& wkt2,
const count_set& expected_count1, count_set const& expected_count1,
int expected_point_count1, int expected_point_count1,
expectation_limits const& expected_area1, expectation_limits const& expected_area1,
const count_set& expected_count2, count_set const& expected_count2,
int expected_point_count2, int expected_point_count2,
expectation_limits const& expected_area2, expectation_limits const& expected_area2,
ut_settings const& settings = ut_settings()) ut_settings const& settings = ut_settings())

View File

@ -67,7 +67,7 @@ template<typename IntersectionOutput, typename G1, typename G2>
void check_result(IntersectionOutput const& intersection_output, void check_result(IntersectionOutput const& intersection_output,
std::string const& caseid, std::string const& caseid,
G1 const& g1, G2 const& g2, 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, int expected_point_count, expectation_limits const& expected_length_or_area,
ut_settings const& settings) ut_settings const& settings)
{ {
@ -165,8 +165,8 @@ void check_result(IntersectionOutput const& intersection_output,
template <typename OutputType, typename CalculationType, typename G1, typename G2> template <typename OutputType, typename CalculationType, typename G1, typename G2>
typename bg::default_area_result<G1>::type test_intersection(std::string const& caseid, typename bg::default_area_result<G1>::type test_intersection(std::string const& caseid,
G1 const& g1, G2 const& g2, G1 const& g1, G2 const& g2,
const count_set& expected_count = count_set(), count_set const& expected_count = count_set(),
const count_set& expected_hole_count = count_set(), count_set const& expected_hole_count = count_set(),
int expected_point_count = 0, expectation_limits const& expected_length_or_area = 0, int expected_point_count = 0, expectation_limits const& expected_length_or_area = 0,
ut_settings const& settings = ut_settings()) ut_settings const& settings = ut_settings())
{ {
@ -289,7 +289,7 @@ typename bg::default_area_result<G1>::type test_intersection(std::string const&
template <typename OutputType, typename CalculationType, typename G1, typename G2> template <typename OutputType, typename CalculationType, typename G1, typename G2>
typename bg::default_area_result<G1>::type test_intersection(std::string const& caseid, typename bg::default_area_result<G1>::type test_intersection(std::string const& caseid,
G1 const& g1, G2 const& g2, 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, expectation_limits const& expected_length_or_area = 0,
ut_settings const& settings = ut_settings()) ut_settings const& settings = ut_settings())
{ {
@ -303,8 +303,8 @@ typename bg::default_area_result<G1>::type test_intersection(std::string const&
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
typename bg::default_area_result<G1>::type test_one(std::string const& caseid, typename bg::default_area_result<G1>::type test_one(std::string const& caseid,
std::string const& wkt1, std::string const& wkt2, std::string const& wkt1, std::string const& wkt2,
const count_set& expected_count, count_set const& expected_count,
const count_set& expected_hole_count, count_set const& expected_hole_count,
int expected_point_count, int expected_point_count,
expectation_limits const& expected_length_or_area, expectation_limits const& expected_length_or_area,
ut_settings const& settings = ut_settings()) ut_settings const& settings = ut_settings())
@ -328,7 +328,7 @@ typename bg::default_area_result<G1>::type test_one(std::string const& caseid,
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
typename bg::default_area_result<G1>::type test_one(std::string const& caseid, typename bg::default_area_result<G1>::type test_one(std::string const& caseid,
std::string const& wkt1, std::string const& wkt2, std::string const& wkt1, std::string const& wkt2,
const count_set& expected_count, count_set const& expected_count,
int expected_point_count, int expected_point_count,
expectation_limits const& expected_length_or_area, expectation_limits const& expected_length_or_area,
ut_settings const& settings = ut_settings()) ut_settings const& settings = ut_settings())
@ -342,7 +342,7 @@ typename bg::default_area_result<G1>::type test_one(std::string const& caseid,
template <typename OutputType, typename Areal, typename Linear> template <typename OutputType, typename Areal, typename Linear>
void test_one_lp(std::string const& caseid, void test_one_lp(std::string const& caseid,
std::string const& wkt_areal, std::string const& wkt_linear, 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, expectation_limits const& expected_length = 0,
ut_settings const& settings = ut_settings()) ut_settings const& settings = ut_settings())
{ {

View File

@ -68,7 +68,7 @@ inline std::size_t num_points(Range const& rng, bool add_for_open = false)
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
void test_union(std::string const& caseid, G1 const& g1, G2 const& g2, 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, int expected_point_count, expectation_limits const& expected_area,
ut_settings const& settings) ut_settings const& settings)
{ {
@ -240,7 +240,7 @@ void test_union(std::string const& caseid, G1 const& g1, G2 const& g2,
template <typename OutputType, typename G1, typename G2> template <typename OutputType, typename G1, typename G2>
void test_one(std::string const& caseid, void test_one(std::string const& caseid,
std::string const& wkt1, std::string const& wkt2, 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, int expected_point_count, expectation_limits const& expected_area,
ut_settings const& settings = ut_settings()) ut_settings const& settings = ut_settings())
{ {

View File

@ -18,7 +18,7 @@ namespace bg = boost::geometry;
namespace test namespace test
{ {
template <typename P, typename CP> template <typename P, typename CP>
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<P>)); BOOST_CONCEPT_ASSERT((bg::concepts::Point<P>));
BOOST_CONCEPT_ASSERT((bg::concepts::ConstPoint<P>)); BOOST_CONCEPT_ASSERT((bg::concepts::ConstPoint<P>));

View File

@ -17,7 +17,7 @@ namespace bg = boost::geometry;
namespace test namespace test
{ {
template <typename P, typename C> template <typename P, typename C>
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<P>)); BOOST_CONCEPT_ASSERT((bg::concepts::Point<P>));
BOOST_CONCEPT_ASSERT((bg::concepts::ConstPoint<C>)); BOOST_CONCEPT_ASSERT((bg::concepts::ConstPoint<C>));

View File

@ -49,7 +49,7 @@ struct count_set
return m_values.count(value) > 0; 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 << "{"; os << "{";
for (std::size_t const& value : s.m_values) for (std::size_t const& value : s.m_values)
@ -60,7 +60,7 @@ struct count_set
return os; return os;
} }
count_set operator+(const count_set& a) const count_set operator+(count_set const& a) const
{ {
count_set result; count_set result;
result.m_values = combine(this->m_values, a.m_values); result.m_values = combine(this->m_values, a.m_values);
@ -71,7 +71,7 @@ private :
typedef std::set<std::size_t> set_type; typedef std::set<std::size_t> set_type;
set_type m_values; 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; set_type result;
if (a.size() == 1 && b.size() == 1) if (a.size() == 1 && b.size() == 1)

View File

@ -42,7 +42,7 @@ struct expectation_limits
bool has_two_limits() const { return m_lower_limit < m_upper_limit; } bool has_two_limits() const { return m_lower_limit < m_upper_limit; }
template<typename T> template<typename T>
bool contains_logarithmic(const T& value, double tolerance) const bool contains_logarithmic(T const& value, double tolerance) const
{ {
using std::abs; using std::abs;
using std::log; using std::log;
@ -50,7 +50,7 @@ struct expectation_limits
} }
template<typename T> template<typename T>
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) if (m_upper_limit < 1.0e-8)
{ {
@ -80,7 +80,7 @@ struct expectation_limits
: expectation_limits(this->m_lower_limit + a.m_lower_limit); : 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()) if (lim.has_two_limits())
{ {

View File

@ -17,7 +17,7 @@
#include <fstream> #include <fstream>
template <typename Ring> template <typename Ring>
void fill(Ring& ring, const std::vector<typename boost::geometry::point_type<Ring>::type>& v) void fill(Ring& ring, std::vector<typename boost::geometry::point_type<Ring>::type> const& v)
{ {
ring.custom_clear(); ring.custom_clear();
for(auto const& p : v) for(auto const& p : v)

View File

@ -74,7 +74,7 @@ template<> struct access<test::test_point, 0>
return p.c1; 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; p.c1 = value;
} }
@ -87,7 +87,7 @@ template<> struct access<test::test_point, 1>
return p.c2; 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; p.c2 = value;
} }
@ -100,7 +100,7 @@ template<> struct access<test::test_point, 2>
return p.c3; 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; p.c3 = value;
} }