diff --git a/extensions/test/gis/io/wkb/read_wkb.cpp b/extensions/test/gis/io/wkb/read_wkb.cpp index 6b51c20fc1..921e2e548e 100644 --- a/extensions/test/gis/io/wkb/read_wkb.cpp +++ b/extensions/test/gis/io/wkb/read_wkb.cpp @@ -7,6 +7,7 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +#include #include #include #include @@ -14,7 +15,6 @@ #include #include #include -#include #include #include @@ -37,7 +37,7 @@ namespace bg = boost::geometry; namespace { // anonymous -typedef std::vector byte_vector; +typedef std::vector byte_vector; template void test_geometry_wrong_wkb(std::string const& wkbhex, std::string const& wkt) diff --git a/extensions/test/gis/io/wkb/write_wkb.cpp b/extensions/test/gis/io/wkb/write_wkb.cpp index 9205efb219..dc45eac294 100644 --- a/extensions/test/gis/io/wkb/write_wkb.cpp +++ b/extensions/test/gis/io/wkb/write_wkb.cpp @@ -11,12 +11,9 @@ #include #include -#include - #include #include #include -#include #include #include diff --git a/include/boost/geometry/algorithms/area.hpp b/include/boost/geometry/algorithms/area.hpp index 50f48d7292..16848aa4f1 100644 --- a/include/boost/geometry/algorithms/area.hpp +++ b/include/boost/geometry/algorithms/area.hpp @@ -20,7 +20,8 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_AREA_HPP #define BOOST_GEOMETRY_ALGORITHMS_AREA_HPP -#include +#include + #include #include #include @@ -91,7 +92,7 @@ struct ring_area assert_dimension(); // Ignore warning (because using static method sometimes) on strategy - boost::ignore_unused(strategies); + std::ignore = strategies; // An open ring has at least three points, // A closed ring has at least four points, diff --git a/include/boost/geometry/algorithms/centroid.hpp b/include/boost/geometry/algorithms/centroid.hpp index 1817d8addc..9df80d380f 100644 --- a/include/boost/geometry/algorithms/centroid.hpp +++ b/include/boost/geometry/algorithms/centroid.hpp @@ -23,8 +23,8 @@ #include +#include -#include #include #include #include @@ -168,7 +168,7 @@ struct centroid_range_state Strategy const& strategy, State& state) { - boost::ignore_unused(strategy); + std::ignore = strategy; detail::closed_view const view(ring); auto it = boost::begin(view); @@ -296,7 +296,7 @@ struct centroid_multi_point_state Strategy const& strategy, State& state) { - boost::ignore_unused(strategy); + std::ignore = strategy; strategy.apply(static_cast(transformer.apply(point)), state); } diff --git a/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp b/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp index 64a30a5770..2e17ca261a 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -219,8 +218,6 @@ struct buffer_range output_point_type& last_p1, output_point_type& last_p2) { - boost::ignore_unused(segment_strategy); - using point_type = typename std::iterator_traits < Iterator @@ -915,8 +912,6 @@ inline void buffer_inserter(GeometryInput const& geometry_input, OutputIterator VisitPiecesPolicy& visit_pieces_policy ) { - boost::ignore_unused(visit_pieces_policy); - using collection_type = detail::buffer::buffered_piece_collection < geometry::ring_type_t, 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 e5cda56765..9eafad0d71 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp @@ -18,8 +18,8 @@ #include #include #include +#include -#include #include #include #include @@ -838,7 +838,7 @@ struct buffered_piece_collection inline void add_endcap(EndcapStrategy const& strategy, Range const& range, point_type const& end_point) { - boost::ignore_unused(strategy); + std::ignore = strategy; if (range.empty()) { 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 9c9509ce72..5ae1718011 100644 --- a/include/boost/geometry/algorithms/detail/buffer/get_piece_turns.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/get_piece_turns.hpp @@ -15,7 +15,6 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_GET_PIECE_TURNS_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_GET_PIECE_TURNS_HPP -#include #include #include #include @@ -288,10 +287,8 @@ class piece_turn_visitor template inline bool apply(Section const& section1, Section const& section2, - bool first = true) + bool = true) { - boost::ignore_unused(first); - auto const& piece1 = m_pieces[section1.ring_id.source_index]; auto const& piece2 = m_pieces[section2.ring_id.source_index]; 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 070a3f6f67..fc336231f3 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 @@ -15,7 +15,8 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_BUFFER_TURN_IN_ORIGINAL_VISITOR -#include +#include + #include #include @@ -114,7 +115,7 @@ template inline bool point_in_range(Strategy& strategy, State& state, Point const& point, Iterator begin, Iterator end) { - boost::ignore_unused(strategy); + std::ignore = strategy; Iterator it = begin; for (Iterator previous = it++; it != end; ++previous, ++it) diff --git a/include/boost/geometry/algorithms/detail/centroid/translating_transformer.hpp b/include/boost/geometry/algorithms/detail/centroid/translating_transformer.hpp index 593131d055..a02e845c96 100644 --- a/include/boost/geometry/algorithms/detail/centroid/translating_transformer.hpp +++ b/include/boost/geometry/algorithms/detail/centroid/translating_transformer.hpp @@ -19,9 +19,8 @@ #include - -#include -#include +#include +#include #include #include @@ -54,7 +53,7 @@ template struct translating_transformer { using point_type = geometry::point_type_t; - using result_type = boost::reference_wrapper; + using result_type = std::reference_wrapper; explicit translating_transformer(Geometry const&) {} explicit translating_transformer(point_type const&) {} @@ -82,12 +81,12 @@ struct translating_transformer pt_it = geometry::points_begin(geom); if ( pt_it != geometry::points_end(geom) ) { - m_origin = boost::addressof(*pt_it); + m_origin = std::addressof(*pt_it); } } explicit translating_transformer(point_type const& origin) - : m_origin(boost::addressof(origin)) + : m_origin(std::addressof(origin)) {} result_type apply(point_type const& pt) const diff --git a/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp b/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp index f26af3f264..63c93331c2 100644 --- a/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp +++ b/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp @@ -80,12 +80,12 @@ class range_to_range_rtree BOOST_GEOMETRY_ASSERT( n > 0 ); // n above is unused outside BOOST_GEOMETRY_ASSERT, - // hence the call to boost::ignore_unused below + // hence the use of std::ignore below // // however, t_v (initialized by the call to rt.query(...)) // is used below, which is why we cannot put the call to // rt.query(...) inside BOOST_GEOMETRY_ASSERT - boost::ignore_unused(n); + std::ignore = n; Distance dist = dispatch::distance < diff --git a/include/boost/geometry/algorithms/detail/closest_points/point_to_geometry.hpp b/include/boost/geometry/algorithms/detail/closest_points/point_to_geometry.hpp index 97e3c4ad4d..370befdd89 100644 --- a/include/boost/geometry/algorithms/detail/closest_points/point_to_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/closest_points/point_to_geometry.hpp @@ -11,9 +11,9 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_CLOSEST_POINTS_POINT_TO_GEOMETRY_HPP #include +#include #include -#include #include #include #include @@ -72,7 +72,7 @@ struct point_to_segment geometry::detail::assign_point_from_index<0>(segment, p[0]); geometry::detail::assign_point_from_index<1>(segment, p[1]); - boost::ignore_unused(strategies); + std::ignore = strategies; auto closest_point = strategies.closest_points(point, segment) .apply(point, p[0], p[1]); diff --git a/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp b/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp index 33ba1796a6..6d7fc919d7 100644 --- a/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp +++ b/include/boost/geometry/algorithms/detail/covered_by/implementation.hpp @@ -21,7 +21,6 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_COVERED_BY_IMPLEMENTATION_HPP #include -#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/distance/box_to_box.hpp b/include/boost/geometry/algorithms/detail/distance/box_to_box.hpp index 8cb7b5c3dc..b127023deb 100644 --- a/include/boost/geometry/algorithms/detail/distance/box_to_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/box_to_box.hpp @@ -11,7 +11,7 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_BOX_TO_BOX_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_BOX_TO_BOX_HPP -#include +#include #include #include @@ -39,7 +39,7 @@ struct distance { static inline auto apply(Box1 const& box1, Box2 const& box2, Strategies const& strategies) { - boost::ignore_unused(strategies); + std::ignore = strategies; return strategies.distance(box1, box2).apply(box1, box2); } }; diff --git a/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp b/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp index cf332734dd..b5d6045af6 100644 --- a/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/distance/point_to_geometry.hpp @@ -22,9 +22,9 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_DISTANCE_POINT_TO_GEOMETRY_HPP #include +#include #include -#include #include #include #include @@ -71,7 +71,7 @@ struct point_to_point static inline auto apply(P1 const& p1, P2 const& p2, Strategies const& strategies) { - boost::ignore_unused(strategies); + std::ignore = strategies; return strategies.distance(p1, p2).apply(p1, p2); } }; @@ -84,7 +84,7 @@ struct point_to_point static inline auto apply(P1 const& p1, P2 const& p2, Strategy const& strategy) { - boost::ignore_unused(strategy); + std::ignore = strategy; return strategy.apply(p1, p2); } }; @@ -104,7 +104,7 @@ struct point_to_segment geometry::detail::assign_point_from_index<0>(segment, p[0]); geometry::detail::assign_point_from_index<1>(segment, p[1]); - boost::ignore_unused(strategies); + std::ignore = strategies; return strategies.distance(point, segment).apply(point, p[0], p[1]); } }; @@ -121,7 +121,7 @@ struct point_to_segment geometry::detail::assign_point_from_index<0>(segment, p[0]); geometry::detail::assign_point_from_index<1>(segment, p[1]); - boost::ignore_unused(strategy); + std::ignore = strategy; return strategy.apply(point, p[0], p[1]); } }; @@ -137,7 +137,7 @@ struct point_to_box static inline auto apply(Point const& point, Box const& box, Strategies const& strategies) { - boost::ignore_unused(strategies); + std::ignore = strategies; return strategies.distance(point, box).apply(point, box); } }; @@ -150,7 +150,7 @@ struct point_to_box static inline auto apply(Point const& point, Box const& box, Strategy const& strategy) { - boost::ignore_unused(strategy); + std::ignore = strategy; return strategy.apply(point, box); } }; diff --git a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp index 70fefae32a..4d570d42d6 100644 --- a/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/segment_to_box.hpp @@ -16,11 +16,10 @@ #include #include +#include #include #include -#include - #include #include #include @@ -222,7 +221,7 @@ class segment_to_box_2D_generic // Use both Poin < ps_strategy_type >::apply(ps_strategy); - boost::ignore_unused(ps_strategy, ps_cstrategy); + std::ignore = ps_cstrategy; for (unsigned int i = 0; i < 4; ++i) { @@ -234,7 +233,7 @@ class segment_to_box_2D_generic // Use both Poin < pb_strategy_type >::apply(pb_strategy); - boost::ignore_unused(pb_strategy, pb_cstrategy); + std::ignore = pb_cstrategy; cd[4] = pb_cstrategy.apply(p[0], box); cd[5] = pb_cstrategy.apply(p[1], box); diff --git a/include/boost/geometry/algorithms/detail/expand/segment.hpp b/include/boost/geometry/algorithms/detail/expand/segment.hpp index c09c664e22..f77bf513d2 100644 --- a/include/boost/geometry/algorithms/detail/expand/segment.hpp +++ b/include/boost/geometry/algorithms/detail/expand/segment.hpp @@ -20,8 +20,6 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_EXPAND_SEGMENT_HPP -#include - #include #include diff --git a/include/boost/geometry/algorithms/detail/intersection/areal_areal.hpp b/include/boost/geometry/algorithms/detail/intersection/areal_areal.hpp index cea95807e0..bf6f2980cf 100644 --- a/include/boost/geometry/algorithms/detail/intersection/areal_areal.hpp +++ b/include/boost/geometry/algorithms/detail/intersection/areal_areal.hpp @@ -11,8 +11,6 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_INTERSECTION_AREAL_AREAL_HPP -#include - #include @@ -80,14 +78,11 @@ struct intersection_areal_areal_ TupledOut >::type; - boost::ignore_unused - < - geometry::detail::expect_output - < - Areal1, Areal2, single_out, - point_tag, linestring_tag, polygon_tag - > - >(); + (void)sizeof(geometry::detail::expect_output + < + Areal1, Areal2, single_out, + point_tag, linestring_tag, polygon_tag + >); using areal = geometry::detail::output_geometry_access < diff --git a/include/boost/geometry/algorithms/detail/is_valid/box.hpp b/include/boost/geometry/algorithms/detail/is_valid/box.hpp index 69a4d4e78e..26c2707eab 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/box.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/box.hpp @@ -12,8 +12,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_BOX_HPP #include - -#include +#include #include #include @@ -61,7 +60,7 @@ struct has_valid_corners template static inline bool apply(Box const&, VisitPolicy& visitor) { - boost::ignore_unused(visitor); + std::ignore = visitor; return visitor.template apply(); } diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp index 5eb9a253c9..ee7a935ed0 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/has_duplicates.hpp @@ -11,7 +11,8 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_HAS_DUPLICATES_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_HAS_DUPLICATES_HPP -#include +#include + #include #include #include @@ -40,7 +41,7 @@ struct has_duplicates static inline bool apply(Range const& range, VisitPolicy& visitor, Strategy const& ) { - boost::ignore_unused(visitor); + std::ignore = visitor; detail::closed_view const view(range); diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp index 35a48ec515..d97ebc54a7 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/has_invalid_coordinate.hpp @@ -13,6 +13,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_HAS_INVALID_COORDINATE_HPP #include +#include #include #include @@ -47,7 +48,7 @@ struct point_has_invalid_coordinate template static inline bool apply(Point const& point, VisitPolicy& visitor) { - boost::ignore_unused(visitor); + std::ignore = visitor; return geometry::has_non_finite_coordinate(point) @@ -83,7 +84,7 @@ struct range_has_invalid_coordinate template static inline bool apply(Geometry const& geometry, VisitPolicy& visitor) { - boost::ignore_unused(visitor); + std::ignore = visitor; auto const points_end = geometry::points_end(geometry); bool const has_valid_coordinates = std::none_of diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_spikes.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_spikes.hpp index 08e9ab43d2..d7115979f5 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/has_spikes.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/has_spikes.hpp @@ -12,8 +12,8 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_HAS_SPIKES_HPP #include +#include -#include #include #include #include @@ -71,7 +71,7 @@ struct has_spikes Strategy const& strategy, bool is_linear) { - boost::ignore_unused(visitor); + std::ignore = visitor; auto cur = boost::begin(view); auto prev = find_different_from_first(boost::rbegin(view), @@ -94,9 +94,9 @@ struct has_spikes static inline bool apply(Range const& range, VisitPolicy& visitor, Strategy const& strategy) { - boost::ignore_unused(visitor); + std::ignore = visitor; - bool const is_linestring = util::is_linestring::value; + constexpr bool is_linestring = util::is_linestring::value; detail::closed_view const view(range); diff --git a/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp b/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp index 9798694c63..c1851ff2d5 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/has_valid_self_turns.hpp @@ -11,9 +11,9 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_HAS_VALID_SELF_TURNS_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_HAS_VALID_SELF_TURNS_HPP +#include #include -#include #include #include @@ -60,7 +60,7 @@ class has_valid_self_turns VisitPolicy& visitor, Strategy const& strategy) { - boost::ignore_unused(visitor); + std::ignore = visitor; detail::overlay::stateless_predicate_based_interrupt_policy < diff --git a/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp b/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp index 5bf5e7334d..20b11aba57 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/multipolygon.hpp @@ -14,9 +14,9 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_MULTIPOLYGON_HPP #include +#include #include -#include #include #include #include @@ -90,7 +90,7 @@ class is_valid_multipolygon VisitPolicy& visitor, Strategy const& strategy) { - boost::ignore_unused(visitor); + std::ignore = visitor; // collect all polygons that have crossing turns std::set multi_indices; diff --git a/include/boost/geometry/algorithms/detail/is_valid/pointlike.hpp b/include/boost/geometry/algorithms/detail/is_valid/pointlike.hpp index f4523454ac..e64d98c8f8 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/pointlike.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/pointlike.hpp @@ -12,7 +12,6 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_POINTLIKE_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_POINTLIKE_HPP -#include #include #include @@ -40,7 +39,6 @@ struct is_valid template static inline bool apply(Point const& point, VisitPolicy& visitor, Strategy const&) { - boost::ignore_unused(visitor); return ! detail::is_valid::has_invalid_coordinate < Point @@ -62,8 +60,6 @@ struct is_valid VisitPolicy& visitor, Strategy const&) { - boost::ignore_unused(multipoint, visitor); - if BOOST_GEOMETRY_CONSTEXPR (! AllowEmptyMultiGeometries) { if (boost::empty(multipoint)) diff --git a/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp b/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp index 8e81df2477..6420d019d9 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/polygon.hpp @@ -22,9 +22,9 @@ #include #include #include +#include #include -#include #include #include @@ -265,7 +265,7 @@ class is_valid_polygon VisitPolicy& visitor, Strategy const& strategy) { - boost::ignore_unused(visitor); + std::ignore = visitor; // collect the interior ring indices that have turns with the // exterior ring @@ -394,7 +394,7 @@ class is_valid_polygon VisitPolicy& visitor, Strategy const& ) { - boost::ignore_unused(visitor); + std::ignore = visitor; typedef typename std::iterator_traits < diff --git a/include/boost/geometry/algorithms/detail/is_valid/ring.hpp b/include/boost/geometry/algorithms/detail/is_valid/ring.hpp index 810b94a453..c38786d789 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/ring.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/ring.hpp @@ -14,11 +14,10 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_RING_HPP #include +#include #include -#include - #include #include #include @@ -65,7 +64,7 @@ struct is_topologically_closed template static inline bool apply(Ring const&, VisitPolicy& visitor, Strategy const&) { - boost::ignore_unused(visitor); + std::ignore = visitor; return visitor.template apply(); } @@ -77,7 +76,7 @@ struct is_topologically_closed template static inline bool apply(Ring const& ring, VisitPolicy& visitor, Strategy const& strategy) { - boost::ignore_unused(visitor); + std::ignore = visitor; using geometry::detail::equals::equals_point_point; if (equals_point_point(range::front(ring), range::back(ring), strategy)) @@ -100,7 +99,7 @@ struct is_properly_oriented static inline bool apply(Ring const& ring, VisitPolicy& visitor, Strategy const& strategy) { - boost::ignore_unused(visitor); + std::ignore = visitor; // Check area auto const area = detail::area::ring_area::apply(ring, strategy); diff --git a/include/boost/geometry/algorithms/detail/is_valid/segment.hpp b/include/boost/geometry/algorithms/detail/is_valid/segment.hpp index a2a6f061f8..75f3d5b84b 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/segment.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/segment.hpp @@ -11,8 +11,6 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_SEGMENT_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_VALID_SEGMENT_HPP -#include - #include #include @@ -47,8 +45,6 @@ struct is_valid template static inline bool apply(Segment const& segment, VisitPolicy& visitor, Strategy const& strategy) { - boost::ignore_unused(visitor); - point_type_t p[2]; detail::assign_point_from_index<0>(segment, p[0]); detail::assign_point_from_index<1>(segment, p[1]); diff --git a/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp b/include/boost/geometry/algorithms/detail/overlay/append_no_dups_or_spikes.hpp index 03b4813420..8ac9520e51 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 @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp b/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp index af5136593a..cb20a52c92 100644 --- a/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/check_enrich.hpp @@ -19,9 +19,9 @@ #endif // BOOST_GEOMETRY_DEBUG_ENRICH #include +#include #include -#include #include #include #include @@ -68,7 +68,8 @@ inline void display(MetaTurn const& meta_turn, const char* reason = "") << " " << reason << std::endl; #else -boost::ignore_unused(meta_turn, reason); + std::ignore = meta_turn; + std::ignore = reason; #endif } 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 2c45437103..345b605f5d 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -15,7 +15,6 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_HPP -#include #include #include @@ -61,20 +60,20 @@ namespace detail { namespace overlay struct policy_verify_nothing { - static bool const use_side_verification = false; - static bool const use_start_turn = false; - static bool const use_handle_as_touch = false; - static bool const use_handle_as_equal = false; - static bool const use_handle_imperfect_touch = false; + static bool constexpr use_side_verification = false; + static bool constexpr use_start_turn = false; + static bool constexpr use_handle_as_touch = false; + static bool constexpr use_handle_as_equal = false; + static bool constexpr use_handle_imperfect_touch = false; }; struct policy_verify_all { - static bool const use_side_verification = true; - static bool const use_start_turn = true; - static bool const use_handle_as_touch = true; - static bool const use_handle_as_equal = true; - static bool const use_handle_imperfect_touch = true; + static bool constexpr use_side_verification = true; + static bool constexpr use_start_turn = true; + static bool constexpr use_handle_as_touch = true; + static bool constexpr use_handle_as_equal = true; + static bool constexpr use_handle_imperfect_touch = true; }; using verify_policy_aa = policy_verify_all; @@ -441,9 +440,9 @@ struct touch_interior : public base_turn_handler // 2) Important is: if q_k goes to LEFT, RIGHT, COLLINEAR // and, if LEFT/COLL, if it is lying LEFT or RIGHT w.r.t. q_i - BOOST_STATIC_ASSERT(Index <= 1); - static unsigned int const index_p = Index; - static unsigned int const index_q = 1 - Index; + static_assert(Index <= 1, "Index must not be greater than 1"); + constexpr unsigned int index_p = Index; + constexpr unsigned int index_q = 1 - Index; bool const has_pk = ! range_p.is_last_segment(); bool const has_qk = ! range_q.is_last_segment(); @@ -1206,7 +1205,7 @@ private : static inline bool set_tp(int side_rk_r, TurnInfo& tp, IntersectionInfo const& intersection_info) { - BOOST_STATIC_ASSERT(Index <= 1); + static_assert(Index <= 1, "Index must not be greater than 1"); operation_type blocked = operation_blocked; switch(side_rk_r) 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 59602625ed..e1f4b8099b 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 @@ -14,7 +14,7 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_FOR_ENDPOINT_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_GET_TURN_INFO_FOR_ENDPOINT_HPP -#include +#include #include #include @@ -197,7 +197,7 @@ class linear_intersections template ip_info const& get() const { - BOOST_STATIC_ASSERT(I < 2); + static_assert(I < 2, "I must not be greater than 1"); return ips[I]; } @@ -233,7 +233,7 @@ struct get_turn_info_for_endpoint { using operations_pair = std::pair; - BOOST_STATIC_ASSERT(EnableFirst || EnableLast); + static_assert(EnableFirst || EnableLast, "One of EnableFirst or EnableLast must be set"); template #include #include +#include #include -#include #include #include #include @@ -229,7 +229,9 @@ class get_turns_in_sections // It checks if it is areal (box, ring, (multi)polygon) signed_size_type const n = static_cast(section.range_count); - boost::ignore_unused(n, index1, index2); + std::ignore = n; + std::ignore = index1; + std::ignore = index2; return util::is_areal::value && index1 == 0 @@ -249,8 +251,6 @@ public : Turns& turns, InterruptPolicy& interrupt_policy) { - boost::ignore_unused(interrupt_policy); - static bool const areal1 = util::is_areal::value; static bool const areal2 = util::is_areal::value; @@ -381,6 +381,7 @@ public : { return false; } + std::ignore = interrupt_policy; } } } @@ -680,8 +681,6 @@ struct get_turns_cs Turns& turns, InterruptPolicy& interrupt_policy) { - boost::ignore_unused(interrupt_policy); - // Depending on code some relations can be left out using turn_info = typename boost::range_value::type; @@ -717,6 +716,7 @@ struct get_turns_cs { interrupt_policy.apply(turns); } + std::ignore = interrupt_policy; } diff --git a/include/boost/geometry/algorithms/detail/overlay/graph/assign_counts.hpp b/include/boost/geometry/algorithms/detail/overlay/graph/assign_counts.hpp index f35bd7a1ef..01d12fed07 100644 --- a/include/boost/geometry/algorithms/detail/overlay/graph/assign_counts.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/graph/assign_counts.hpp @@ -80,22 +80,22 @@ void assign_counts(Turn& turn) } }; - auto assign_left_for = [&turn, &assign_for](counts_per_op_t const& op1, counts_per_op_t op2) + auto assign_left_for = [&assign_for](counts_per_op_t const& op1, counts_per_op_t op2) { assign_for(op1, op2, [](auto& enriched, auto count) { enriched.count_left = count; }); }; - auto assign_right_for = [&turn, &assign_for](counts_per_op_t const& op1, counts_per_op_t op2) + auto assign_right_for = [&assign_for](counts_per_op_t const& op1, counts_per_op_t op2) { assign_for(op1, op2, [](auto& enriched, auto count) { enriched.count_right = count; }); }; - auto assign_left_incoming_for = [&turn, &assign_for](counts_per_op_t const& op1, counts_per_op_t op2) + auto assign_left_incoming_for = [&assign_for](counts_per_op_t const& op1, counts_per_op_t op2) { assign_for(op1, op2, [](auto& enriched, auto count) { enriched.count_left_incoming = count; }); }; - auto assign_right_incoming_for = [&turn, &assign_for](counts_per_op_t const& op1, counts_per_op_t op2) + auto assign_right_incoming_for = [&assign_for](counts_per_op_t const& op1, counts_per_op_t op2) { assign_for(op1, op2, [](auto& enriched, auto count) { enriched.count_right_incoming = count; }); }; diff --git a/include/boost/geometry/algorithms/detail/overlay/graph/detect_biconnected_components.hpp b/include/boost/geometry/algorithms/detail/overlay/graph/detect_biconnected_components.hpp index c6416124ba..7a34c0bb73 100644 --- a/include/boost/geometry/algorithms/detail/overlay/graph/detect_biconnected_components.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/graph/detect_biconnected_components.hpp @@ -162,7 +162,7 @@ template second.is_extra ? it->second.original_node_id diff --git a/include/boost/geometry/algorithms/detail/overlay/graph/select_edge.hpp b/include/boost/geometry/algorithms/detail/overlay/graph/select_edge.hpp index 738473b892..e178e4120d 100644 --- a/include/boost/geometry/algorithms/detail/overlay/graph/select_edge.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/graph/select_edge.hpp @@ -9,7 +9,8 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_SELECT_EDGE_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_SELECT_EDGE_HPP -#include +#include + #include #include #include @@ -257,8 +258,6 @@ struct edge_selector return true; }; - boost::ignore_unused(assert_one_cluster); - // It often happens there are just two collinear edges. // If they travel to the same target, take either. if (edges.size() == 2) @@ -283,6 +282,7 @@ struct edge_selector // Because it is clustered, and all operations come from the same cluster, // the rank can be used, which is more efficient. BOOST_GEOMETRY_ASSERT(assert_one_cluster()); + std::ignore = assert_one_cluster; turn_operation_id result; if (select_toi_for_union(result, op0, op1, edges[0].toi, edges[1].toi, m_turns)) diff --git a/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp b/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp index d789b7db35..08bc6e04f8 100644 --- a/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/handle_colocations.hpp @@ -20,7 +20,6 @@ #include #include -#include #include #include #include diff --git a/include/boost/geometry/algorithms/detail/point_on_border.hpp b/include/boost/geometry/algorithms/detail/point_on_border.hpp index 4bb02da65d..8b973718af 100644 --- a/include/boost/geometry/algorithms/detail/point_on_border.hpp +++ b/include/boost/geometry/algorithms/detail/point_on_border.hpp @@ -23,7 +23,6 @@ #include #include -#include #include #include diff --git a/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp b/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp index 3d39a1c65c..f7b7fdd117 100644 --- a/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp +++ b/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp @@ -204,9 +204,10 @@ class no_turns_aa_pred template struct areal_areal { - // check Linear / Areal - BOOST_STATIC_ASSERT(topological_dimension::value == 2 - && topological_dimension::value == 2); + // check Areal / Areal + static_assert( topological_dimension::value == 2 + && topological_dimension::value == 2, + "Geometry1 and Geometry2 must be areal"); static const bool interruption_enabled = true; diff --git a/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp b/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp index 5b66269d3a..3db8a19672 100644 --- a/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp +++ b/include/boost/geometry/algorithms/detail/relate/boundary_checker.hpp @@ -12,7 +12,6 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_BOUNDARY_CHECKER_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_BOUNDARY_CHECKER_HPP -#include #include #include @@ -30,6 +29,10 @@ #include #include +#ifndef BOOST_GEOMETRY_DEBUG_RELATE_BOUNDARY_CHECKER +#include +#endif + namespace boost { namespace geometry { @@ -63,12 +66,13 @@ class boundary_checker template bool is_endpoint_boundary(Point const& pt) const { - boost::ignore_unused(pt); #ifdef BOOST_GEOMETRY_DEBUG_RELATE_BOUNDARY_CHECKER // may give false positives for INT BOOST_GEOMETRY_ASSERT( detail::equals::equals_point_point(pt, range::front(m_geometry), m_strategy) || detail::equals::equals_point_point(pt, range::back(m_geometry), m_strategy)); +#else + std::ignore = pt; #endif return m_has_boundary; } diff --git a/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp b/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp index 8ca9049072..21634dca60 100644 --- a/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp +++ b/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp @@ -16,8 +16,8 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_FOLLOW_HELPERS_HPP #include +#include -#include #include #include @@ -32,8 +32,6 @@ #include #include -#include - namespace boost { namespace geometry { diff --git a/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp b/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp index 9be59bd737..ee1837fc78 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp @@ -14,7 +14,8 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_LINEAR_AREAL_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_LINEAR_AREAL_HPP -#include +#include + #include #include @@ -261,8 +262,8 @@ inline bool calculate_from_inside(Geometry1 const& geometry1, Turn const& turn, Strategy const& strategy) { - static const std::size_t op_id = OpId; - static const std::size_t other_op_id = (OpId + 1) % 2; + constexpr std::size_t op_id = OpId; + constexpr std::size_t other_op_id = (OpId + 1) % 2; if (turn.operations[op_id].position == overlay::position_front) { @@ -321,8 +322,9 @@ template struct linear_areal { // check Linear / Areal - BOOST_STATIC_ASSERT(topological_dimension::value == 1 - && topological_dimension::value == 2); + static_assert( topological_dimension::value == 1 + && topological_dimension::value == 2, + "Geometry1 must be linear, Geometry2 must be areal"); static const bool interruption_enabled = true; @@ -1189,9 +1191,6 @@ struct linear_areal OtherGeometry const& /*other_geometry*/, BoundaryChecker const& boundary_checker) { - boost::ignore_unused(first, last); - //BOOST_GEOMETRY_ASSERT( first != last ); - // For MultiPolygon many x/u operations may be generated as a first IP // if for all turns x/u was generated and any of the Polygons doesn't contain the LineString // then we know that the LineString is outside @@ -1243,6 +1242,8 @@ struct linear_areal m_interior_detected = false; BOOST_GEOMETRY_ASSERT(first != last); + std::ignore = first; + std::ignore = last; BOOST_GEOMETRY_ASSERT(m_previous_turn_ptr); segment_identifier const& prev_seg_id = m_previous_turn_ptr->operations[op_id].seg_id; diff --git a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp index 8a326265af..5aaa47cac3 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp @@ -15,8 +15,8 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_LINEAR_LINEAR_HPP #include +#include -#include #include #include @@ -585,9 +585,6 @@ struct linear_linear BoundaryChecker const& boundary_checker, OtherBoundaryChecker const& /*other_boundary_checker*/) { - boost::ignore_unused(first, last); - //BOOST_GEOMETRY_ASSERT( first != last ); - // here, the possible exit is the real one // we know that we entered and now we exit if ( /*m_exit_watcher.get_exit_operation() == overlay::operation_union // THIS CHECK IS REDUNDANT @@ -597,6 +594,8 @@ struct linear_linear update(res); BOOST_GEOMETRY_ASSERT(first != last); + std::ignore = first; + std::ignore = last; const TurnInfo * turn_ptr = NULL; if ( m_degenerated_turn_ptr ) diff --git a/include/boost/geometry/algorithms/detail/relate/result.hpp b/include/boost/geometry/algorithms/detail/relate/result.hpp index de982c37a8..df4e186640 100644 --- a/include/boost/geometry/algorithms/detail/relate/result.hpp +++ b/include/boost/geometry/algorithms/detail/relate/result.hpp @@ -40,7 +40,7 @@ enum field { interior = 0, boundary = 1, exterior = 2 }; // TODO: IF THE RESULT IS UPDATED WITH THE MAX POSSIBLE VALUE FOR SOME PAIR OF GEOEMTRIES // THE VALUE ALREADY STORED MUSN'T BE CHECKED // update() calls chould be replaced with set() in those cases -// but for safety reasons (STATIC_ASSERT) we should check if parameter D is valid and set() doesn't do that +// but for safety reasons (static_assert) we should check if parameter D is valid and set() doesn't do that // so some additional function could be added, e.g. set_dim() @@ -80,7 +80,7 @@ class matrix inline char get() const { static const std::size_t index = F1 * Width + F2; - BOOST_STATIC_ASSERT(index < static_size); + static_assert(index < static_size, "index must be smaller than static_size"); return m_array[index]; } @@ -92,13 +92,13 @@ class matrix inline void set() { static const std::size_t index = F1 * Width + F2; - BOOST_STATIC_ASSERT(index < static_size); + static_assert(index < static_size, "index must be smaller than static_size"); m_array[index] = V; } inline char operator[](std::size_t index) const { - BOOST_GEOMETRY_ASSERT(index < static_size); + static_assert(index < static_size, "index must be smaller than static_size"); return m_array[index]; } @@ -162,7 +162,7 @@ class matrix_handler template inline bool may_update() const { - BOOST_STATIC_ASSERT('0' <= D && D <= '9'); + static_assert('0' <= D && D <= '9', "D must be a digit"); char const c = m_matrix.template get(); return D > c || c > '9'; } @@ -170,7 +170,7 @@ class matrix_handler template inline void update() { - BOOST_STATIC_ASSERT(('0' <= V && V <= '9') || V == 'T'); + static_assert(('0' <= V && V <= '9') || V == 'T', "V must be a digit or 'T'"); char const c = m_matrix.template get(); // If c == T and V == T it will be set anyway but that's fine if (V > c || c > '9') @@ -182,7 +182,7 @@ class matrix_handler template inline void set() { - BOOST_STATIC_ASSERT(('0' <= V && V <= '9') || V == 'T'); + static_assert(('0' <= V && V <= '9') || V == 'T', "V must be a digit or 'T'"); m_matrix.template set(); } @@ -249,7 +249,7 @@ class mask inline char get() const { static const std::size_t index = F1 * Width + F2; - BOOST_STATIC_ASSERT(index < static_size); + static_assert(index < static_size, "index must be smaller than static_size"); return m_array[index]; } @@ -357,7 +357,7 @@ struct may_update_dispatch template static inline bool apply(Mask const& mask, Matrix const& matrix) { - BOOST_STATIC_ASSERT('0' <= D && D <= '9'); + static_assert('0' <= D && D <= '9', "D must be a digit"); char const m = mask.template get(); @@ -626,7 +626,7 @@ template struct static_check_characters> : static_check_characters> { - typedef std::integer_sequence type; + using type = std::integer_sequence; static const bool is_valid = (C >= '0' && C <= '9') || C == 'T' || C == 'F' || C == '*'; BOOST_GEOMETRY_STATIC_ASSERT((is_valid), @@ -647,14 +647,14 @@ struct static_mask static const std::size_t static_height = Height; static const std::size_t static_size = Width * Height; - BOOST_STATIC_ASSERT( - std::size_t(util::sequence_size::value) == static_size); + static_assert(std::size_t(util::sequence_size::value) == static_size, + "util::sequence_size::value must equal static_size"); template struct static_get { - BOOST_STATIC_ASSERT(std::size_t(F1) < static_height); - BOOST_STATIC_ASSERT(std::size_t(F2) < static_width); + static_assert(std::size_t(F1) < static_height, "F1 out of bound"); + static_assert(std::size_t(F2) < static_width, "F2 out of bound"); static const char value = util::sequence_element::value; @@ -1190,7 +1190,7 @@ template struct result_dimension { static const std::size_t dim = geometry::dimension::value; - BOOST_STATIC_ASSERT(dim >= 0); + static_assert(dim >= 0, "dim must not be negative"); static const char value = (dim <= 9) ? ('0' + dim) : 'T'; }; diff --git a/include/boost/geometry/algorithms/detail/relate/turns.hpp b/include/boost/geometry/algorithms/detail/relate/turns.hpp index 868b1761d7..294ce9d850 100644 --- a/include/boost/geometry/algorithms/detail/relate/turns.hpp +++ b/include/boost/geometry/algorithms/detail/relate/turns.hpp @@ -247,7 +247,7 @@ struct less_other_multi_index template struct less { - BOOST_STATIC_ASSERT(OpId < 2); + static_assert(OpId < 2, "OpId musst be 0 or 1"); template static inline bool use_fraction(Turn const& left, Turn const& right) diff --git a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp index f72738bdc4..c1d3d13d58 100644 --- a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp +++ b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -393,11 +392,9 @@ struct sectionalize_part using box_type = typename section_type::box_type; using point_type = geometry::point_type_t; - BOOST_STATIC_ASSERT - ( - section_type::dimension_count - == util::sequence_size::value - ); + static_assert( + section_type::dimension_count == util::sequence_size::value, + "section_type::dimension_count must equal util::sequence_size::value"); std::size_t const count = std::distance(begin, end); if (count == 0) diff --git a/include/boost/geometry/algorithms/detail/sweep.hpp b/include/boost/geometry/algorithms/detail/sweep.hpp index a8c7f9a91a..df0e39d8b7 100644 --- a/include/boost/geometry/algorithms/detail/sweep.hpp +++ b/include/boost/geometry/algorithms/detail/sweep.hpp @@ -11,10 +11,9 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_SWEEP_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SWEEP_HPP -#include - -#include +#include +#include namespace boost { namespace geometry { @@ -65,7 +64,7 @@ inline void sweep(Range const& range, PriorityQueue& queue, } } - boost::ignore_unused(interrupt_policy); + std::ignore = interrupt_policy; //Ignore unused warnings when only static members are accessed. } diff --git a/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp b/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp index 3d45a46d16..9ee57d81f1 100644 --- a/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp +++ b/include/boost/geometry/algorithms/detail/throw_on_empty_input.hpp @@ -23,7 +23,6 @@ #include - // BSG 2012-02-06: we use this currently only for distance. // For other scalar results area,length,perimeter it is commented on purpose. // Reason is that for distance there is no other choice. distance of two @@ -35,7 +34,7 @@ // scalar results, except distance. #if defined(BOOST_GEOMETRY_EMPTY_INPUT_NO_THROW) -#include +#include #endif namespace boost { namespace geometry @@ -54,7 +53,7 @@ inline void throw_on_empty_input(Geometry const& geometry) BOOST_THROW_EXCEPTION(empty_input_exception()); } #else - boost::ignore_unused(geometry); + std::ignore = geometry; #endif } diff --git a/include/boost/geometry/algorithms/detail/touches/implementation.hpp b/include/boost/geometry/algorithms/detail/touches/implementation.hpp index a29fa8ff45..e49e9a6987 100644 --- a/include/boost/geometry/algorithms/detail/touches/implementation.hpp +++ b/include/boost/geometry/algorithms/detail/touches/implementation.hpp @@ -112,12 +112,12 @@ struct box_box template static inline bool apply(Box1 const& b1, Box2 const& b2, Strategy const& /*strategy*/) { - BOOST_STATIC_ASSERT((std::is_same - < - geometry::coordinate_system_t, - geometry::coordinate_system_t - >::value - )); + static_assert(std::is_same + < + geometry::coordinate_system_t, + geometry::coordinate_system_t + >::value, + "Box1 and Box2 must have the same coordinate system"); assert_dimension_equal(); bool touches = false; diff --git a/include/boost/geometry/algorithms/detail/turns/compare_turns.hpp b/include/boost/geometry/algorithms/detail/turns/compare_turns.hpp index ec383bf103..5d32f92c81 100644 --- a/include/boost/geometry/algorithms/detail/turns/compare_turns.hpp +++ b/include/boost/geometry/algorithms/detail/turns/compare_turns.hpp @@ -36,8 +36,8 @@ template > struct less_seg_fraction_other_op { - BOOST_STATIC_ASSERT(OpId < 2); - static const std::size_t other_op_id = (OpId + 1) % 2; + static_assert(OpId < 2, "OpId must be 0 or 1"); + static constexpr std::size_t other_op_id = (OpId + 1) % 2; template static inline int order_op(Op const& op) diff --git a/include/boost/geometry/algorithms/detail/within/implementation.hpp b/include/boost/geometry/algorithms/detail/within/implementation.hpp index b5300a9934..6dc54bd53e 100644 --- a/include/boost/geometry/algorithms/detail/within/implementation.hpp +++ b/include/boost/geometry/algorithms/detail/within/implementation.hpp @@ -22,8 +22,6 @@ #include #include -#include - #include #include #include diff --git a/include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp b/include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp index 7ef58a8132..fb15dee27d 100644 --- a/include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp +++ b/include/boost/geometry/algorithms/detail/within/point_in_geometry.hpp @@ -20,7 +20,6 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_WITHIN_POINT_IN_GEOMETRY_HPP -#include #include #include #include diff --git a/include/boost/geometry/core/access.hpp b/include/boost/geometry/core/access.hpp index 8b28de0d29..70e8e6bbd6 100644 --- a/include/boost/geometry/core/access.hpp +++ b/include/boost/geometry/core/access.hpp @@ -270,7 +270,7 @@ struct signature_getset_index_dimension {}; template constexpr inline coordinate_type_t get(Geometry const& geometry #ifndef DOXYGEN_SHOULD_SKIP_THIS - , detail::signature_getset_dimension* = 0 + , detail::signature_getset_dimension* = nullptr #endif ) { @@ -299,7 +299,7 @@ template inline void set(Geometry& geometry , coordinate_type_t const& value #ifndef DOXYGEN_SHOULD_SKIP_THIS - , detail::signature_getset_dimension* = 0 + , detail::signature_getset_dimension* = nullptr #endif ) { @@ -329,7 +329,7 @@ inline void set(Geometry& geometry template constexpr inline coordinate_type_t get(Geometry const& geometry #ifndef DOXYGEN_SHOULD_SKIP_THIS - , detail::signature_getset_index_dimension* = 0 + , detail::signature_getset_index_dimension* = nullptr #endif ) { @@ -360,7 +360,7 @@ template inline void set(Geometry& geometry , coordinate_type_t const& value #ifndef DOXYGEN_SHOULD_SKIP_THIS - , detail::signature_getset_index_dimension* = 0 + , detail::signature_getset_index_dimension* = nullptr #endif ) { diff --git a/include/boost/geometry/core/coordinate_dimension.hpp b/include/boost/geometry/core/coordinate_dimension.hpp index 7f2e94ac0d..3103fd51a9 100644 --- a/include/boost/geometry/core/coordinate_dimension.hpp +++ b/include/boost/geometry/core/coordinate_dimension.hpp @@ -22,6 +22,7 @@ #include + #include #include #include @@ -108,7 +109,7 @@ inline constexpr std::size_t dimension_v = dimension::value; template constexpr inline void assert_dimension() { - BOOST_STATIC_ASSERT(( dimension::value == Dimensions )); + static_assert( dimension::value == Dimensions, "dimension::value and Dimensions must match" ); } /*! @@ -118,13 +119,13 @@ constexpr inline void assert_dimension() template constexpr inline void assert_dimension_less_equal() { - BOOST_STATIC_ASSERT(( dimension::value <= Dimensions )); + static_assert( dimension::value <= Dimensions, "dimension::value must be less than or equal to Dimensions" ); } template constexpr inline void assert_dimension_greater_equal() { - BOOST_STATIC_ASSERT(( dimension::value >= Dimensions )); + static_assert( dimension::value >= Dimensions, "dimension::value must be greater than or equal to Dimensions" ); } /*! @@ -134,7 +135,7 @@ constexpr inline void assert_dimension_greater_equal() template constexpr inline void assert_dimension_equal() { - BOOST_STATIC_ASSERT(( dimension::value == dimension::value )); + static_assert( dimension::value == dimension::value, "dimension::value and dimension::value must match" ); } }} // namespace boost::geometry diff --git a/include/boost/geometry/core/radius.hpp b/include/boost/geometry/core/radius.hpp index 984f61a9e9..589760c870 100644 --- a/include/boost/geometry/core/radius.hpp +++ b/include/boost/geometry/core/radius.hpp @@ -238,7 +238,7 @@ struct radius_access : detail::radius_access { //BOOST_STATIC_ASSERT(Dimension == 0); - BOOST_STATIC_ASSERT(Dimension < 3); + static_assert(Dimension < 3, "Dimension must be smaller than 3"); }; template @@ -252,7 +252,7 @@ struct radius_access : detail::radius_access { //BOOST_STATIC_ASSERT(Dimension == 0 || Dimension == 2); - BOOST_STATIC_ASSERT(Dimension < 3); + static_assert(Dimension < 3, "Dimension must be smaller than 3"); }; } // namespace core_dispatch diff --git a/include/boost/geometry/core/static_assert.hpp b/include/boost/geometry/core/static_assert.hpp index d320c3d2e0..c119032a14 100644 --- a/include/boost/geometry/core/static_assert.hpp +++ b/include/boost/geometry/core/static_assert.hpp @@ -12,8 +12,6 @@ #include -#include - namespace boost { namespace geometry { namespace detail { diff --git a/include/boost/geometry/extensions/algebra/algorithms/detail.hpp b/include/boost/geometry/extensions/algebra/algorithms/detail.hpp index 41d08b7413..730c666841 100644 --- a/include/boost/geometry/extensions/algebra/algorithms/detail.hpp +++ b/include/boost/geometry/extensions/algebra/algorithms/detail.hpp @@ -23,8 +23,6 @@ #include #include -#include - namespace boost { namespace geometry { @@ -45,7 +43,7 @@ inline void cross(S1 const& s1, S2 const& s2, D & d) template struct dot_impl { - BOOST_STATIC_ASSERT(0 < N); + static_assert(0 < N, "N must be positive"); typedef typename geometry::select_most_precise< typename geometry::coordinate_type::type, @@ -88,7 +86,7 @@ dot(S1 const& s1, S2 const& s2) template struct mul_impl { - BOOST_STATIC_ASSERT(0 < N); + static_assert(0 < N, "N must be positive"); static inline void apply(S & s, T const& v) { @@ -114,7 +112,7 @@ inline static void mul(S & s, T const& v) template struct neg_impl { - BOOST_STATIC_ASSERT(0 < N); + static_assert(0 < N, "N must be positive"); static inline void apply(V & v) { @@ -152,7 +150,7 @@ inline static void normalize(S & s) template struct matrix_mul_row_impl { - BOOST_STATIC_ASSERT(0 < N); + static_assert(0 < N, "N must be positive"); static const std::size_t dimension = geometry::dimension::value; diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/matrix_concept.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/matrix_concept.hpp index fd9520aa0a..fcc4d15f0d 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/matrix_concept.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/matrix_concept.hpp @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -48,7 +47,7 @@ class Matrix { static void apply() { - G* g = 0; + G* g = nullptr; geometry::set(*g, geometry::get(*g)); dimension_checker_row::apply(); } @@ -109,9 +108,13 @@ class ConstMatrix { static void apply() { - const G* g = 0; - typename coordinate_type::type coord(geometry::get(*g)); - boost::ignore_unused(coord); + const G* g = nullptr; + static_assert(std::is_constructible + < + typename coordinate_type::type, + decltype(geometry::get(*g)) + >::value, + "coordinate_type::type must be constructible from get(const G&)") dimension_checker_row::apply(); } }; diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/quaternion_concept.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/quaternion_concept.hpp index b3d9e8d074..eb05f00176 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/quaternion_concept.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/quaternion_concept.hpp @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -43,7 +42,7 @@ class Quaternion { static void apply() { - G* g = 0; + G* g = nullptr; geometry::set(*g, geometry::get(*g)); dimension_checker::apply(); } @@ -77,17 +76,14 @@ class ConstQuaternion { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - //typedef typename coordinate_type::type ctype; - //typedef typename coordinate_system::type csystem; - template struct dimension_checker { static void apply() { - const G* g = 0; - typename coordinate_type::type coord(geometry::get(*g)); - boost::ignore_unused(coord); + const G* g = nullptr; + static_assert(std::is_constructible::type, decltype(geometry::get(*g))>::value, + "coordinate_type::type must be constructible from get(const G&)"); dimension_checker::apply(); } }; diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_matrix_concept.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_matrix_concept.hpp index 2370e65f1f..1730b64031 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_matrix_concept.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_matrix_concept.hpp @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -48,7 +47,7 @@ class RotationMatrix { static void apply() { - G* g = 0; + G* g = nullptr; geometry::set(*g, geometry::get(*g)); dimension_checker_row::apply(); } @@ -107,9 +106,9 @@ class ConstRotationMatrix { static void apply() { - const G* g = 0; - ctype coord(geometry::get(*g)); - boost::ignore_unused(coord); + const G* g = nullptr; + static_assert(std::is_constructible(*g))>::value, + "coordinate_type::type must be constructible from get(const G&)"); dimension_checker_row::apply(); } }; diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_quaternion_concept.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_quaternion_concept.hpp index fbd4ffc407..4b1b0ee56e 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_quaternion_concept.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/rotation_quaternion_concept.hpp @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -46,7 +45,7 @@ class RotationQuaternion { static void apply() { - G* g = 0; + G* g = nullptr; geometry::set(*g, geometry::get(*g)); dimension_checker::apply(); } @@ -92,9 +91,9 @@ class ConstRotationQuaternion { static void apply() { - const G* g = 0; - ctype coord(geometry::get(*g)); - boost::ignore_unused(coord); + const G* g = nullptr; + static_assert(std::is_constructible(*g))>::value, + "coordinate_type::type must be constructible from get(const G&)") dimension_checker::apply(); } }; diff --git a/include/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp b/include/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp index a3f50a6466..8d2cf63775 100644 --- a/include/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/concepts/vector_concept.hpp @@ -22,7 +22,6 @@ #include #include -#include #include #include @@ -49,7 +48,7 @@ class Vector { static void apply() { - V* v = 0; + V* v = nullptr; geometry::set(*v, geometry::get(*v)); dimension_checker::apply(); } @@ -93,9 +92,9 @@ class ConstVector { static void apply() { - const V* v = 0; - ctype coord(geometry::get(*v)); - boost::ignore_unused(coord); + const V* v = nullptr; + static_assert(std::is_constructible(*v))>::value, + "coordinate_type::type must be constructible from get(const V&)"); dimension_checker::apply(); } }; diff --git a/include/boost/geometry/extensions/algebra/geometries/matrix.hpp b/include/boost/geometry/extensions/algebra/geometries/matrix.hpp index 0b90d9ed75..de47ab9d92 100644 --- a/include/boost/geometry/extensions/algebra/geometries/matrix.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/matrix.hpp @@ -49,8 +49,8 @@ class matrix template inline T const& get() const { - BOOST_STATIC_ASSERT(I < Rows); - BOOST_STATIC_ASSERT(J < Cols); + static_assert(I < Rows, "I out of bound"); + static_assert(J < Cols, "J out of bound"); return m_values[I + Rows * J]; } @@ -61,8 +61,8 @@ class matrix template inline void set(T const& value) { - BOOST_STATIC_ASSERT(I < Rows); - BOOST_STATIC_ASSERT(J < Cols); + static_assert(I < Rows, "I out of bound"); + static_assert(J < Cols, "J out of bound"); m_values[I + Rows * J] = value; } diff --git a/include/boost/geometry/extensions/algebra/geometries/quaternion.hpp b/include/boost/geometry/extensions/algebra/geometries/quaternion.hpp index 843bb18d32..91c9660361 100644 --- a/include/boost/geometry/extensions/algebra/geometries/quaternion.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/quaternion.hpp @@ -61,7 +61,7 @@ class quaternion template inline T const& get() const { - BOOST_STATIC_ASSERT(K < 4); + static_assert(K < 4, "K must be smaller than 4"); return m_values[K]; } @@ -71,7 +71,7 @@ class quaternion template inline void set(T const& value) { - BOOST_STATIC_ASSERT(K < 4); + static_assert(K < 4, "K must be smaller than 4"); m_values[K] = value; } diff --git a/include/boost/geometry/extensions/algebra/geometries/rotation_matrix.hpp b/include/boost/geometry/extensions/algebra/geometries/rotation_matrix.hpp index bb4f75b511..1ed66db1ca 100644 --- a/include/boost/geometry/extensions/algebra/geometries/rotation_matrix.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/rotation_matrix.hpp @@ -50,8 +50,8 @@ class rotation_matrix template inline T const& get() const { - BOOST_STATIC_ASSERT(I < Dimension); - BOOST_STATIC_ASSERT(J < Dimension); + static_assert(I < Dimension, "I out of bound"); + static_assert(J < Dimension, "J out of bound"); return m_values[I * Dimension + J]; } @@ -62,8 +62,8 @@ class rotation_matrix template inline void set(T const& value) { - BOOST_STATIC_ASSERT(I < Dimension); - BOOST_STATIC_ASSERT(J < Dimension); + static_assert(I < Dimension, "I out of bound"); + static_assert(J < Dimension, "J out of bound"); m_values[I * Dimension + J] = value; } diff --git a/include/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp b/include/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp index 9e3b6274ba..dbafb74ec9 100644 --- a/include/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/rotation_quaternion.hpp @@ -64,7 +64,7 @@ class rotation_quaternion template inline T const& get() const { - BOOST_STATIC_ASSERT(K < 4); + static_assert(K < 4, "K must be smaller than 4"); return m_values[K]; } @@ -74,7 +74,7 @@ class rotation_quaternion template inline void set(T const& value) { - BOOST_STATIC_ASSERT(K < 4); + static_assert(K < 4, "K must be smaller than 4"); m_values[K] = value; } diff --git a/include/boost/geometry/extensions/algebra/geometries/vector.hpp b/include/boost/geometry/extensions/algebra/geometries/vector.hpp index 72e604b944..485beb867a 100644 --- a/include/boost/geometry/extensions/algebra/geometries/vector.hpp +++ b/include/boost/geometry/extensions/algebra/geometries/vector.hpp @@ -59,7 +59,7 @@ class vector template inline CoordinateType const& get() const { - BOOST_STATIC_ASSERT(K < DimensionCount); + static_assert(K < DimensionCount, "K out of bound"); return m_values[K]; } @@ -69,7 +69,7 @@ class vector template inline void set(CoordinateType const& value) { - BOOST_STATIC_ASSERT(K < DimensionCount); + static_assert(K < DimensionCount, "K out of bound"); m_values[K] = value; } diff --git a/include/boost/geometry/extensions/algorithms/distance_info.hpp b/include/boost/geometry/extensions/algorithms/distance_info.hpp index d64bc2d9ec..7a4d74a3b8 100644 --- a/include/boost/geometry/extensions/algorithms/distance_info.hpp +++ b/include/boost/geometry/extensions/algorithms/distance_info.hpp @@ -19,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/include/boost/geometry/extensions/gis/io/shapefile/read.hpp b/include/boost/geometry/extensions/gis/io/shapefile/read.hpp index de11af392c..2d386cb824 100644 --- a/include/boost/geometry/extensions/gis/io/shapefile/read.hpp +++ b/include/boost/geometry/extensions/gis/io/shapefile/read.hpp @@ -11,11 +11,10 @@ #include +#include #include -#include #include -#include #include #include @@ -87,12 +86,12 @@ inline void read_little(IStream & is, T & v) inline void double_endianness_check() { - BOOST_STATIC_ASSERT(sizeof(double) == 8); - BOOST_STATIC_ASSERT(sizeof(double) * CHAR_BIT == 64); + static_assert(sizeof(double) == 8, "sizeof(double) must be 8"); + static_assert(CHAR_BIT == 8, "CHAR_BIT must be 8"); double d = 0; unsigned char* c = reinterpret_cast(&d); - boost::int64_t* i = reinterpret_cast(&d); + std::int64_t* i = reinterpret_cast(&d); c[0] = 0xd0; c[1] = 0x61; @@ -117,20 +116,20 @@ inline void double_endianness_check() template inline void read_little(IStream & is, double & v) { - BOOST_STATIC_ASSERT(sizeof(double) * CHAR_BIT == 64); + static_assert(sizeof(double) * CHAR_BIT == 64, "double must be 64 bit"); is.read(reinterpret_cast(&v), sizeof(double)); - boost::int64_t * proxy = reinterpret_cast(&v); + std::int64_t * proxy = reinterpret_cast(&v); boost::endian::little_to_native_inplace(*proxy); } template -inline boost::int32_t reset_and_read_header(IStream & is) +inline std::int32_t reset_and_read_header(IStream & is) { is.clear(); is.seekg(0); - boost::int32_t code = 0; + std::int32_t code = 0; read_big(is, code); if (code != 9994) @@ -139,9 +138,9 @@ inline boost::int32_t reset_and_read_header(IStream & is) } // 5 unused, length, version - is.seekg(7 * sizeof(boost::int32_t), IStream::cur); + is.seekg(7 * sizeof(std::int32_t), IStream::cur); - boost::int32_t type = 0; + std::int32_t type = 0; read_little(is, type); // TODO: support filtering @@ -174,9 +173,9 @@ inline bool read_record_header(IStream & is) //read_big(is, number); //read_big(is, length); - is.seekg(sizeof(boost::int32_t), IStream::cur); + is.seekg(sizeof(std::int32_t), IStream::cur); // only to set flags - boost::int32_t foo; + std::int32_t foo; read_native(is, foo); return is.good(); @@ -247,16 +246,16 @@ struct read_and_set_z template inline void read_and_set_back_z(IStream & is, Range & rng) { - typedef typename boost::range_value::type pt_type; - pt_type & pt = range::back(rng); + using pt_type = typename boost::range_value::type; + auto& pt = range::back(rng); read_and_set_z::apply(is, pt); } template inline void read_and_set_z_at(IStream & is, Range & rng, std::size_t index) { - typedef typename boost::range_value::type pt_type; - pt_type & pt = range::at(rng, index); + using pt_type = typename boost::range_value::type; + auto& pt = range::at(rng, index); read_and_set_z::apply(is, pt); } @@ -313,7 +312,7 @@ inline void read_and_set_point(IStream & is, Point & pt) template inline void read_and_push_back_point(IStream & is, Range & rng) { - typedef typename boost::range_value::type pt_type; + using pt_type = typename boost::range_value::type; pt_type pt; read_and_set_point(is, pt); @@ -324,9 +323,7 @@ inline void read_and_push_back_point(IStream & is, Range & rng) template inline void read_and_set_point_at(IStream & is, Range & rng, std::size_t index) { - typedef typename boost::range_value::type pt_type; - - pt_type & pt = range::at(rng, index); + auto& pt = range::at(rng, index); read_and_set_point(is, pt); } @@ -342,11 +339,11 @@ inline void read_and_set_points(IStream & is, Range & rng, std::size_t num_point template inline void read_parts(IStream & is, - std::vector & parts, - boost::int32_t num_parts) + std::vector & parts, + std::int32_t num_parts) { parts.resize(num_parts); - for (boost::int32_t i = 0 ; i < num_parts ; ++i) + for (std::int32_t i = 0 ; i < num_parts ; ++i) { read_little(is, parts[i]); } @@ -355,10 +352,10 @@ inline void read_parts(IStream & is, struct read_point_policy { template - static inline void apply(IStream & is, Points & points, boost::int32_t type, + static inline void apply(IStream & is, Points & points, std::int32_t type, Strategy const&) { - boost::int32_t t; + std::int32_t t; read_little(is, t); if (t != type) { @@ -387,12 +384,10 @@ struct read_point_policy struct read_multipoint_policy { template - static inline void apply(IStream & is, Points & points, boost::int32_t type, + static inline void apply(IStream & is, Points & points, std::int32_t type, Strategy const&) { - typedef typename boost::range_value::type pt_type; - - boost::int32_t t; + std::int32_t t; read_little(is, t); if (t != type) { @@ -401,7 +396,7 @@ struct read_multipoint_policy is.seekg(4 * sizeof(double), IStream::cur); // box - boost::int32_t num_points; + std::int32_t num_points; read_little(is, num_points); if (num_points < 0) @@ -437,17 +432,16 @@ struct read_multipoint_policy struct read_polyline_policy { template - static inline void apply(IStream &is, Linestrings & linestrings, boost::int32_t type, + static inline void apply(IStream &is, Linestrings & linestrings, std::int32_t type, Strategy const&) { - typedef typename boost::range_value::type ls_type; - typedef typename boost::range_value::type pt_type; + using ls_type = typename boost::range_value::type; - boost::int32_t t; + std::int32_t t; //double min_x, min_y, max_x, max_y; - boost::int32_t num_parts; - boost::int32_t num_points; - std::vector parts; + std::int32_t num_parts; + std::int32_t num_points; + std::vector parts; read_little(is, t); if (t != type) @@ -471,10 +465,10 @@ struct read_polyline_policy read_parts(is, parts, num_parts); - for (boost::int32_t i = 0; i < num_parts; ++i) + for (std::int32_t i = 0; i < num_parts; ++i) { - boost::int32_t f = parts[i]; - boost::int32_t l = (i + 1) < num_parts ? parts[i + 1] : num_points; + std::int32_t f = parts[i]; + std::int32_t l = (i + 1) < num_parts ? parts[i + 1] : num_points; if (f >= num_points || l > num_points || f > l) { @@ -482,7 +476,7 @@ struct read_polyline_policy } range::push_back(linestrings, ls_type()); - ls_type & ls = range::back(linestrings); + auto& ls = range::back(linestrings); std::size_t ls_size = l - f; range::resize(ls, ls_size); @@ -512,26 +506,25 @@ struct read_polyline_policy struct read_polygon_policy { template - static inline void apply(IStream &is, Polygons & polygons, boost::int32_t type, + static inline void apply(IStream &is, Polygons & polygons, std::int32_t type, Strategy const& strategy) { - typedef typename boost::range_value::type poly_type; - typedef typename geometry::point_type::type pt_type; - typedef typename geometry::ring_type::type ring_type; + using poly_type = typename boost::range_value::type; + using ring_type = typename geometry::ring_type::type; - static const bool is_ccw = geometry::point_order::value == geometry::counterclockwise; - static const bool is_open = geometry::closure::value == geometry::open; + constexpr bool is_ccw = geometry::point_order::value == geometry::counterclockwise; + constexpr bool is_open = geometry::closure::value == geometry::open; typename Strategy::point_order_strategy_type order_strategy = strategy.get_point_order_strategy(); typename Strategy::template point_in_geometry_strategy::type within_strategy = strategy.template get_point_in_geometry_strategy(); - boost::int32_t t; + std::int32_t t; //double min_x, min_y, max_x, max_y; - boost::int32_t num_parts; - boost::int32_t num_points; - std::vector parts; + std::int32_t num_parts; + std::int32_t num_points; + std::vector parts; read_little(is, t); if (t != type) @@ -558,10 +551,10 @@ struct read_polygon_policy std::vector outer_rings; std::vector inner_rings; - for (boost::int32_t i = 0; i < num_parts; ++i) + for (std::int32_t i = 0; i < num_parts; ++i) { - boost::int32_t f = parts[i]; - boost::int32_t l = (i + 1) < num_parts ? parts[i + 1] : num_points; + std::int32_t f = parts[i]; + std::int32_t l = (i + 1) < num_parts ? parts[i + 1] : num_points; if (f >= num_points || l > num_points || f > l) { @@ -608,9 +601,8 @@ struct read_polygon_policy // if ring is ccw reverse leaving the first point untouched if (is_ccw) { - typename boost::range_iterator::type - b = boost::begin(ring), - e = boost::end(ring); + auto b = boost::begin(ring); + auto e = boost::end(ring); std::reverse(++b, is_open ? e : (--e)); } @@ -704,8 +696,7 @@ struct read_polygon_policy // NOTE: The worst case complexity is O(N^2) and best O(N) // R-tree or partition could be used (~O(NlogN)) // but in most cases this version should be faster. - typedef typename boost::range_iterator::type iter_type; - for (iter_type it = boost::begin(inner_ring); it != boost::end(inner_ring); ++it) + for (auto it = boost::begin(inner_ring); it != boost::end(inner_ring); ++it) { if (detail::within::within_point_geometry(*it, outer_ring, within_strategy)) { @@ -718,7 +709,7 @@ struct read_polygon_policy }; template -inline void add_records(IStream & is, Range & rng, boost::int32_t type, +inline void add_records(IStream & is, Range & rng, std::int32_t type, Strategy const& strategy) { while (read_record_header(is)) @@ -728,10 +719,10 @@ inline void add_records(IStream & is, Range & rng, boost::int32_t type, } template -inline void add_records_as_new_element(IStream & is, Range & rng, boost::int32_t type, +inline void add_records_as_new_element(IStream & is, Range & rng, std::int32_t type, Strategy const& strategy) { - typedef typename boost::range_value::type val_type; + using val_type = typename boost::range_value::type; if (! read_record_header(is)) { @@ -739,7 +730,7 @@ inline void add_records_as_new_element(IStream & is, Range & rng, boost::int32_t } range::push_back(rng, val_type()); - val_type & elem = range::back(rng); + auto& elem = range::back(rng); do { @@ -749,15 +740,15 @@ inline void add_records_as_new_element(IStream & is, Range & rng, boost::int32_t } template -inline void add_records_as_new_elements(IStream & is, Range & rng, boost::int32_t type, +inline void add_records_as_new_elements(IStream & is, Range & rng, std::int32_t type, Strategy const& strategy) { - typedef typename boost::range_value::type val_type; + using val_type = typename boost::range_value::type; while (read_record_header(is)) { range::push_back(rng, val_type()); - val_type & elem = range::back(rng); + auto& elem = range::back(rng); Policy::apply(is, elem, type, strategy); } @@ -785,7 +776,7 @@ struct read_shapefile { namespace shp = detail::shapefile; - boost::int32_t const type = shp::reset_and_read_header(is); + std::int32_t const type = shp::reset_and_read_header(is); if (type == shp::shape_type::point || type == shp::shape_type::point_m @@ -810,7 +801,7 @@ struct read_shapefile { namespace shp = detail::shapefile; - boost::int32_t const type = shp::reset_and_read_header(is); + std::int32_t const type = shp::reset_and_read_header(is); if (type == shp::shape_type::point || type == shp::shape_type::point_m @@ -835,7 +826,7 @@ struct read_shapefile { namespace shp = detail::shapefile; - boost::int32_t const type = shp::reset_and_read_header(is); + std::int32_t const type = shp::reset_and_read_header(is); if (type == shp::shape_type::polyline || type == shp::shape_type::polyline_m @@ -854,7 +845,7 @@ struct read_shapefile { namespace shp = detail::shapefile; - boost::int32_t const type = shp::reset_and_read_header(is); + std::int32_t const type = shp::reset_and_read_header(is); if (type == shp::shape_type::polyline || type == shp::shape_type::polyline_m @@ -873,7 +864,7 @@ struct read_shapefile { namespace shp = detail::shapefile; - boost::int32_t const type = shp::reset_and_read_header(is); + std::int32_t const type = shp::reset_and_read_header(is); if (type == shp::shape_type::polygon || type == shp::shape_type::polygon_m @@ -892,7 +883,7 @@ struct read_shapefile { namespace shp = detail::shapefile; - boost::int32_t const type = shp::reset_and_read_header(is); + std::int32_t const type = shp::reset_and_read_header(is); if (type == shp::shape_type::polygon || type == shp::shape_type::polygon_m @@ -912,7 +903,7 @@ template inline void read_shapefile(IStream &is, RangeOfGeometries & range_of_geometries, Strategy const& strategy) { - typedef typename boost::range_value::type geometry_type; + using geometry_type = typename boost::range_value::type; geometry::concepts::check(); @@ -925,11 +916,11 @@ inline void read_shapefile(IStream &is, RangeOfGeometries & range_of_geometries, template inline void read_shapefile(IStream &is, RangeOfGeometries & range_of_geometries) { - typedef typename boost::range_value::type geometry_type; - typedef typename strategies::io::services::default_strategy + using geometry_type = typename boost::range_value::type; + using strategy_type = typename strategies::io::services::default_strategy < geometry_type - >::type strategy_type; + >::type; geometry::concepts::check(); diff --git a/include/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp b/include/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp index 71fdabd2d5..24dbef877a 100644 --- a/include/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp +++ b/include/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp @@ -12,7 +12,6 @@ #include #include "shapefil.h" -#include #include #include @@ -69,7 +68,7 @@ template typename geometry::tag::type >::value > -class shape_creator : public boost::noncopyable +class shape_creator { public : shape_creator(std::string const& name) @@ -90,6 +89,9 @@ public : if (m_dbf) ::DBFClose(m_dbf); } + shape_creator(shape_creator const&) = delete; + shape_creator& operator=(shape_creator const&) = delete; + // Returns: index in shapefile inline int AddShape(Geometry const& geometry) { diff --git a/include/boost/geometry/extensions/gis/io/shapelib/shape_reader.hpp b/include/boost/geometry/extensions/gis/io/shapelib/shape_reader.hpp index 4c1ca7b431..8160f54e76 100644 --- a/include/boost/geometry/extensions/gis/io/shapelib/shape_reader.hpp +++ b/include/boost/geometry/extensions/gis/io/shapelib/shape_reader.hpp @@ -13,7 +13,6 @@ #include "shapefil.h" -#include #include #include @@ -29,7 +28,7 @@ namespace detail template -class shape_reader : public boost::noncopyable +class shape_reader { public : shape_reader(std::string const& name) @@ -54,7 +53,8 @@ public : inline int count() const { return m_count; } - + shape_reader(const shape_reader&) = delete; + shape_reader& operator=(const shape_reader&) = delete; private : diff --git a/include/boost/geometry/extensions/gis/io/wkb/detail/endian.hpp b/include/boost/geometry/extensions/gis/io/wkb/detail/endian.hpp index b02d9b1c15..42390de642 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/detail/endian.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/detail/endian.hpp @@ -22,15 +22,13 @@ #ifndef BOOST_GEOMETRY_DETAIL_ENDIAN_HPP #define BOOST_GEOMETRY_DETAIL_ENDIAN_HPP -#include #include +#include #include #include #include #include -#include -#include #include #if CHAR_BIT != 8 @@ -147,7 +145,8 @@ struct unrolled_byte_loops template static void store_forward(Iterator& bytes, T value) { - BOOST_STATIC_ASSERT((std::is_signed::value)); + static_assert(std::is_signed::value, + "Iterator value_type must be signed"); *bytes = static_cast(value); } @@ -155,7 +154,8 @@ struct unrolled_byte_loops template static void store_backward(Iterator& bytes, T value) { - BOOST_STATIC_ASSERT((std::is_signed::value)); + static_assert(std::is_signed::value, + "Iterator value_type must be signed"); *(bytes - 1) = static_cast(value); } @@ -243,7 +243,7 @@ struct endian_value : public endian_value_base template void load(Iterator bytes) { - endian_value raw; + endian_value raw; raw.load(bytes); double& target_value = base::value; @@ -253,14 +253,14 @@ struct endian_value : public endian_value_base template void store(Iterator bytes) { - boost::uint64_t raw; + std::uint64_t raw; double const& source_value = base::value; - std::memcpy(&raw, &source_value, sizeof(boost::uint64_t)); + std::memcpy(&raw, &source_value, sizeof(std::uint64_t)); store_dispatch < - boost::uint64_t, - sizeof(boost::uint64_t) + std::uint64_t, + sizeof(std::uint64_t) >(bytes, raw, typename base::endian_type(), E()); } }; diff --git a/include/boost/geometry/extensions/gis/io/wkb/detail/ogc.hpp b/include/boost/geometry/extensions/gis/io/wkb/detail/ogc.hpp index 657bcdf491..7d592d84a6 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/detail/ogc.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/detail/ogc.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_GEOMETRY_IO_WKB_DETAIL_OGC_HPP #define BOOST_GEOMETRY_IO_WKB_DETAIL_OGC_HPP -#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp b/include/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp index a8e0e70adc..69e022abea 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp @@ -14,8 +14,8 @@ #define BOOST_GEOMETRY_IO_WKB_DETAIL_PARSER_HPP #include -#include #include +#include #include #include #include @@ -23,11 +23,8 @@ #include #include -#include -#include #include -#include #include #include #include @@ -62,24 +59,26 @@ namespace detail { namespace wkb template struct value_parser { - typedef T value_type; + using value_type = T; template static bool parse(Iterator& it, Iterator end, T& value, byte_order_type::enum_t order) { // Very basic pre-conditions check on stream of bytes passed in - BOOST_STATIC_ASSERT(( - std::is_integral::value_type>::value - )); - BOOST_STATIC_ASSERT((sizeof(boost::uint8_t) == - sizeof(typename std::iterator_traits::value_type) - )); - - typedef typename std::iterator_traits::difference_type diff_type; + static_assert( + std::is_integral::value_type>::value, + "Iterator value_type must be integral" + ); + static_assert(sizeof(std::uint8_t) == + sizeof(typename std::iterator_traits::value_type), + "sizeof Iterator value type must be sizeof(std::uint8_t)" + ); + + using diff_type = typename std::iterator_traits::difference_type; diff_type const required_size = sizeof(T); if (it != end && std::distance(it, end) >= required_size) { - typedef endian::endian_value parsed_value_type; + using parsed_value_type = endian::endian_value; parsed_value_type parsed_value; // Decide on direcion of endianness translation, detault to native @@ -110,8 +109,8 @@ struct byte_order_parser template static bool parse(Iterator& it, Iterator end, byte_order_type::enum_t& order) { - boost::uint8_t value; - if (value_parser::parse(it, end, value, byte_order_type::unknown)) + std::uint8_t value; + if (value_parser::parse(it, end, value, byte_order_type::unknown)) { if (byte_order_type::unknown > value) { @@ -132,8 +131,8 @@ struct geometry_type_parser static bool parse(Iterator& it, Iterator end, byte_order_type::enum_t order) { - boost::uint32_t value; - if (value_parser::parse(it, end, value, order)) + std::uint32_t value; + if (value_parser::parse(it, end, value, order)) { return geometry_type::check(value); } @@ -148,9 +147,9 @@ struct parsing_assigner { template static void run(Iterator& it, Iterator end, P& point, - byte_order_type::enum_t order) + byte_order_type::enum_t order) { - typedef typename coordinate_type

::type coordinate_type; + using coordinate_type = typename coordinate_type

::type; // coordinate type in WKB is always double double value(0); @@ -187,7 +186,7 @@ struct point_parser { template static bool parse(Iterator& it, Iterator end, P& point, - byte_order_type::enum_t order) + byte_order_type::enum_t order) { if (geometry_type_parser

::parse(it, end, order)) { @@ -206,18 +205,18 @@ struct point_container_parser { template static bool parse(Iterator& it, Iterator end, C& container, - byte_order_type::enum_t order) + byte_order_type::enum_t order) { - typedef typename point_type::type point_type; + using point_type = typename point_type::type; - boost::uint32_t num_points(0); - if (!value_parser::parse(it, end, num_points, order)) + std::uint32_t num_points(0); + if (!value_parser::parse(it, end, num_points, order)) { return false; } - typedef typename std::iterator_traits::difference_type size_type; - if(num_points > (std::numeric_limits::max)() ) + using size_type = typename std::iterator_traits::difference_type; + if(num_points > (std::numeric_limits::max)() ) { throw boost::geometry::read_wkb_exception(); } @@ -285,20 +284,20 @@ struct polygon_parser return false; } - boost::uint32_t num_rings(0); - if (!value_parser::parse(it, end, num_rings, order)) + std::uint32_t num_rings(0); + if (!value_parser::parse(it, end, num_rings, order)) { return false; } - typedef typename boost::geometry::ring_return_type::type ring_type; + using ring_type = typename boost::geometry::ring_return_type::type; std::size_t rings_parsed = 0; while (rings_parsed < num_rings && it != end) { if (0 == rings_parsed) { - ring_type ring0 = exterior_ring(polygon); + auto ring0 = exterior_ring(polygon); if (!point_container_parser::parse(it, end, ring0, order)) { return false; @@ -307,7 +306,7 @@ struct polygon_parser else { boost::geometry::range::resize(interior_rings(polygon), rings_parsed); - ring_type ringN = boost::geometry::range::back(interior_rings(polygon)); + auto ringN = boost::geometry::range::back(interior_rings(polygon)); if (!point_container_parser::parse(it, end, ringN, order)) { diff --git a/include/boost/geometry/extensions/gis/io/wkb/detail/writer.hpp b/include/boost/geometry/extensions/gis/io/wkb/detail/writer.hpp index 8345796b2a..d7f5bd4fa9 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/detail/writer.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/detail/writer.hpp @@ -14,17 +14,15 @@ #define BOOST_GEOMETRY_IO_WKB_DETAIL_WRITER_HPP #include -#include #include +#include #include #include #include -#include #include #include #include -#include #include #include @@ -44,7 +42,7 @@ namespace detail { namespace wkb template struct value_writer { - typedef T value_type; + using value_type = T; template static bool write(T const& value, @@ -114,11 +112,11 @@ namespace detail { namespace wkb byte_order_type::enum_t byte_order) { // write endian type - value_writer::write(byte_order, iter, byte_order); + value_writer::write(byte_order, iter, byte_order); // write geometry type - uint32_t type = geometry_type::get(); - value_writer::write(type, iter, byte_order); + std::uint32_t type = geometry_type::get(); + value_writer::write(type, iter, byte_order); // write point's x, y, z writer_assigner::run(point, iter, byte_order); @@ -136,18 +134,17 @@ namespace detail { namespace wkb byte_order_type::enum_t byte_order) { // write endian type - value_writer::write(byte_order, iter, byte_order); + value_writer::write(byte_order, iter, byte_order); // write geometry type - uint32_t type = geometry_type::get(); - value_writer::write(type, iter, byte_order); + std::uint32_t type = geometry_type::get(); + value_writer::write(type, iter, byte_order); // write num points - uint32_t num_points = boost::size(linestring); - value_writer::write(num_points, iter, byte_order); + std::uint32_t num_points = boost::size(linestring); + value_writer::write(num_points, iter, byte_order); - for(typename boost::range_iterator::type - point_iter = boost::begin(linestring); + for(auto point_iter = boost::begin(linestring); point_iter != boost::end(linestring); ++point_iter) { @@ -169,29 +166,25 @@ namespace detail { namespace wkb byte_order_type::enum_t byte_order) { // write endian type - value_writer::write(byte_order, iter, byte_order); - + value_writer::write(byte_order, iter, byte_order); // write geometry type - uint32_t type = geometry_type::get(); - value_writer::write(type, iter, byte_order); + std::uint32_t type = geometry_type::get(); + value_writer::write(type, iter, byte_order); // write num rings - uint32_t num_rings = 1 + geometry::num_interior_rings(polygon); - value_writer::write(num_rings, iter, byte_order); + std::uint32_t num_rings = 1 + geometry::num_interior_rings(polygon); + value_writer::write(num_rings, iter, byte_order); // write exterior ring - typedef typename geometry::ring_type::type - ring_type; + using ring_type = typename geometry::ring_type::type; - typename geometry::ring_return_type::type - exterior_ring = geometry::exterior_ring(polygon); + const auto exterior_ring = geometry::exterior_ring(polygon); - value_writer::write(geometry::num_points(exterior_ring), - iter, - byte_order); + value_writer::write(geometry::num_points(exterior_ring), + iter, + byte_order); - for(typename boost::range_iterator::type - point_iter = boost::begin(exterior_ring); + for(auto point_iter = boost::begin(exterior_ring); point_iter != boost::end(exterior_ring); ++point_iter) { @@ -201,23 +194,17 @@ namespace detail { namespace wkb } // write interor rings - typedef typename geometry::interior_type::type - interior_rings_type; - - typename geometry::interior_return_type::type - interior_rings = geometry::interior_rings(polygon); + const auto interior_rings = geometry::interior_rings(polygon); - for(typename boost::range_iterator::type - ring_iter = boost::begin(interior_rings); + for(auto ring_iter = boost::begin(interior_rings); ring_iter != boost::end(interior_rings); ++ring_iter) { - value_writer::write(geometry::num_points(*ring_iter), - iter, - byte_order); + value_writer::write(geometry::num_points(*ring_iter), + iter, + byte_order); - for(typename boost::range_iterator::type - point_iter = boost::begin(*ring_iter); + for(auto point_iter = boost::begin(*ring_iter); point_iter != boost::end(*ring_iter); ++point_iter) { diff --git a/include/boost/geometry/extensions/gis/io/wkb/read_wkb.hpp b/include/boost/geometry/extensions/gis/io/wkb/read_wkb.hpp index fdcf9cd0d5..bcf55498cc 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/read_wkb.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/read_wkb.hpp @@ -13,11 +13,10 @@ #ifndef BOOST_GEOMETRY_IO_WKB_READ_WKB_HPP #define BOOST_GEOMETRY_IO_WKB_READ_WKB_HPP +#include #include #include -#include - #include #include @@ -74,12 +73,13 @@ template inline bool read_wkb(Iterator begin, Iterator end, Geometry& geometry) { // Stream of bytes can only be parsed using random access iterator. - BOOST_STATIC_ASSERT(( + static_assert( std::is_convertible - < - typename std::iterator_traits::iterator_category, - const std::random_access_iterator_tag& - >::value)); + < + typename std::iterator_traits::iterator_category, + const std::random_access_iterator_tag& + >::value, + "Iterator must be random access"); detail::wkb::byte_order_type::enum_t byte_order; if (detail::wkb::byte_order_parser::parse(begin, end, byte_order)) @@ -97,8 +97,9 @@ inline bool read_wkb(Iterator begin, Iterator end, Geometry& geometry) template inline bool read_wkb(ByteType const* bytes, std::size_t length, Geometry& geometry) { - BOOST_STATIC_ASSERT((std::is_integral::value)); - BOOST_STATIC_ASSERT((sizeof(boost::uint8_t) == sizeof(ByteType))); + static_assert(std::is_integral::value, "ByteType must be integral"); + static_assert(sizeof(std::uint8_t) == sizeof(ByteType), + "Size of ByteType must match size of std::uint8_t"); ByteType const* begin = bytes; ByteType const* const end = bytes + length; diff --git a/include/boost/geometry/extensions/gis/io/wkb/utility.hpp b/include/boost/geometry/extensions/gis/io/wkb/utility.hpp index 11bb53e624..c44d3b0785 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/utility.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/utility.hpp @@ -13,15 +13,13 @@ #ifndef BOOST_GEOMETRY_IO_WKB_UTILITY_HPP #define BOOST_GEOMETRY_IO_WKB_UTILITY_HPP +#include #include #include #include #include #include -#include -#include - #include namespace boost { namespace geometry @@ -34,9 +32,11 @@ template bool hex2wkb(std::string const& hex, OutputIterator bytes) { // Bytes can be only written to output iterator. - BOOST_STATIC_ASSERT((std::is_convertible< - typename std::iterator_traits::iterator_category, - const std::output_iterator_tag&>::value)); + static_assert(std::is_convertible< + typename std::iterator_traits::iterator_category, + const std::output_iterator_tag& + >::value, + "OutputIterator must be std output iterator"); std::string::size_type const byte_size = 2; if (0 != hex.size() % byte_size) @@ -54,7 +54,7 @@ bool hex2wkb(std::string const& hex, OutputIterator bytes) { return false; } - *bytes = static_cast(byte); + *bytes = static_cast(byte); ++bytes; } @@ -65,9 +65,11 @@ template bool wkb2hex(Iterator begin, Iterator end, std::string& hex) { // Stream of bytes can only be passed using random access iterator. - BOOST_STATIC_ASSERT((std::is_convertible< - typename std::iterator_traits::iterator_category, - const std::random_access_iterator_tag&>::value)); + static_assert(std::is_convertible< + typename std::iterator_traits::iterator_category, + const std::random_access_iterator_tag& + >::value, + "Iterator must be random access"); const char hexalpha[] = "0123456789ABCDEF"; char hexbyte[3] = { 0 }; @@ -76,7 +78,7 @@ bool wkb2hex(Iterator begin, Iterator end, std::string& hex) Iterator it = begin; while (it != end) { - boost::uint8_t byte = static_cast(*it); + auto byte = static_cast(*it); hexbyte[0] = hexalpha[(byte >> 4) & 0xf]; hexbyte[1] = hexalpha[byte & 0xf]; hexbyte[2] = '\0'; diff --git a/include/boost/geometry/extensions/gis/io/wkb/write_wkb.hpp b/include/boost/geometry/extensions/gis/io/wkb/write_wkb.hpp index c880a24cc4..6b183c88ed 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/write_wkb.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/write_wkb.hpp @@ -16,8 +16,6 @@ #include #include -#include - #include #include @@ -73,12 +71,14 @@ template inline bool write_wkb(const G& geometry, OutputIterator iter) { // The WKB is written to an OutputIterator. - BOOST_STATIC_ASSERT(( + static_assert( std::is_convertible - < - typename std::iterator_traits::iterator_category, - const std::output_iterator_tag& - >::value)); + < + typename std::iterator_traits::iterator_category, + const std::output_iterator_tag& + >::value, + "OutputIterator must be output iterator" + ); // Will write in the native byte order #ifdef BOOST_BIG_ENDIAN diff --git a/include/boost/geometry/extensions/index/rtree/rtree.hpp b/include/boost/geometry/extensions/index/rtree/rtree.hpp index 852831281e..7c185de855 100644 --- a/include/boost/geometry/extensions/index/rtree/rtree.hpp +++ b/include/boost/geometry/extensions/index/rtree/rtree.hpp @@ -19,7 +19,6 @@ #include #include -#include #include @@ -52,13 +51,12 @@ class rtree * \brief Creates a rtree with maximum elements per node * and minimum (box is ignored). */ - rtree(Box const& box, unsigned int const& maximum, unsigned int const& minimum) + rtree(Box const&, unsigned int const& maximum, unsigned int const& minimum) : m_count(0) , m_min_elems_per_node(minimum) , m_max_elems_per_node(maximum) , m_root(new rtree_node(node_pointer(), 1)) { - boost::ignore_unused(box); } /** diff --git a/include/boost/geometry/extensions/multi/gis/io/wkb/detail/writer.hpp b/include/boost/geometry/extensions/multi/gis/io/wkb/detail/writer.hpp index 6b552b3e9f..d6bd2922c1 100644 --- a/include/boost/geometry/extensions/multi/gis/io/wkb/detail/writer.hpp +++ b/include/boost/geometry/extensions/multi/gis/io/wkb/detail/writer.hpp @@ -15,16 +15,15 @@ #include #include +#include #include #include #include -#include #include #include #include #include -#include #include @@ -36,8 +35,6 @@ #include #include -#include - namespace boost { namespace geometry { @@ -53,20 +50,19 @@ namespace detail { namespace wkb byte_order_type::enum_t byte_order) { // write endian type - value_writer::write(byte_order, iter, byte_order); + value_writer::write(byte_order, iter, byte_order); // write geometry type - uint32_t type = geometry_type::get(); - value_writer::write(type, iter, byte_order); + std::uint32_t type = geometry_type::get(); + value_writer::write(type, iter, byte_order); // write num points - uint32_t num_points = boost::size(multipoint); - value_writer::write(num_points, iter, byte_order); + std::uint32_t num_points = boost::size(multipoint); + value_writer::write(num_points, iter, byte_order); - typedef typename point_type::type point_type; + using point_type = typename point_type::type; - for(typename boost::range_iterator::type - point_iter = boost::begin(multipoint); + for(auto point_iter = boost::begin(multipoint); point_iter != boost::end(multipoint); ++point_iter) { @@ -86,20 +82,19 @@ namespace detail { namespace wkb byte_order_type::enum_t byte_order) { // write endian type - value_writer::write(byte_order, iter, byte_order); + value_writer::write(byte_order, iter, byte_order); // write geometry type - uint32_t type = geometry_type::get(); - value_writer::write(type, iter, byte_order); + std::uint32_t type = geometry_type::get(); + value_writer::write(type, iter, byte_order); // write num linestrings - uint32_t num_linestrings = boost::size(multilinestring); - value_writer::write(num_linestrings, iter, byte_order); + std::uint32_t num_linestrings = boost::size(multilinestring); + value_writer::write(num_linestrings, iter, byte_order); - typedef typename boost::range_value::type linestring_type; + using linestring_type = typename boost::range_value::type; - for(typename boost::range_iterator::type - linestring_iter = boost::begin(multilinestring); + for(auto linestring_iter = boost::begin(multilinestring); linestring_iter != boost::end(multilinestring); ++linestring_iter) { @@ -119,20 +114,19 @@ namespace detail { namespace wkb byte_order_type::enum_t byte_order) { // write endian type - value_writer::write(byte_order, iter, byte_order); + value_writer::write(byte_order, iter, byte_order); // write geometry type - uint32_t type = geometry_type::get(); - value_writer::write(type, iter, byte_order); + std::uint32_t type = geometry_type::get(); + value_writer::write(type, iter, byte_order); // write num polygons - uint32_t num_polygons = boost::size(multipolygon); - value_writer::write(num_polygons, iter, byte_order); + std::uint32_t num_polygons = boost::size(multipolygon); + value_writer::write(num_polygons, iter, byte_order); - typedef typename boost::range_value::type polygon_type; + using polygon_type = typename boost::range_value::type; - for(typename boost::range_iterator::type - polygon_iter = boost::begin(multipolygon); + for(auto polygon_iter = boost::begin(multipolygon); polygon_iter != boost::end(multipolygon); ++polygon_iter) { diff --git a/include/boost/geometry/extensions/nsphere/algorithms/covered_by.hpp b/include/boost/geometry/extensions/nsphere/algorithms/covered_by.hpp index c219ef8b31..d957511b97 100644 --- a/include/boost/geometry/extensions/nsphere/algorithms/covered_by.hpp +++ b/include/boost/geometry/extensions/nsphere/algorithms/covered_by.hpp @@ -19,8 +19,6 @@ #ifndef BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_COVERED_BY_HPP #define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_COVERED_BY_HPP -#include - #include #include diff --git a/include/boost/geometry/extensions/nsphere/algorithms/within.hpp b/include/boost/geometry/extensions/nsphere/algorithms/within.hpp index 758555a0d1..6641b95196 100644 --- a/include/boost/geometry/extensions/nsphere/algorithms/within.hpp +++ b/include/boost/geometry/extensions/nsphere/algorithms/within.hpp @@ -19,7 +19,7 @@ #ifndef BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_WITHIN_HPP #define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_ALGORITHMS_WITHIN_HPP -#include +#include #include #include @@ -73,8 +73,6 @@ inline bool box_in_circle(B const& b, C const& c, S const& strategy) template inline bool range_in_circle(R const& range, C const& c, S const& s) { - ::boost::ignore_unused(s); - for (typename boost::range_iterator::type it = boost::begin(range); it != boost::end(range); ++it) { @@ -85,6 +83,7 @@ inline bool range_in_circle(R const& range, C const& c, S const& s) { return false; } + std::ignore = s; } return true; diff --git a/include/boost/geometry/extensions/nsphere/core/radius.hpp b/include/boost/geometry/extensions/nsphere/core/radius.hpp index 080f1dca9b..124713e7dc 100644 --- a/include/boost/geometry/extensions/nsphere/core/radius.hpp +++ b/include/boost/geometry/extensions/nsphere/core/radius.hpp @@ -47,7 +47,7 @@ template struct radius_access : detail::radius_access { - BOOST_STATIC_ASSERT((D == 0)); + static_assert(D == 0, "D must be zero"); }; } // namespace core_dispatch diff --git a/include/boost/geometry/extensions/nsphere/geometries/concepts/nsphere_concept.hpp b/include/boost/geometry/extensions/nsphere/geometries/concepts/nsphere_concept.hpp index a89528ce49..b4cc4058c0 100644 --- a/include/boost/geometry/extensions/nsphere/geometries/concepts/nsphere_concept.hpp +++ b/include/boost/geometry/extensions/nsphere/geometries/concepts/nsphere_concept.hpp @@ -18,8 +18,9 @@ #ifndef BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_CONCEPTS_NSPHERE_CONCEPT_HPP #define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_GEOMETRIES_CONCEPTS_NSPHERE_CONCEPT_HPP +#include + #include -#include #include #include @@ -37,8 +38,8 @@ namespace boost { namespace geometry { namespace concepts { template class ConstNsphere { - typedef typename point_type::type point_type; - typedef typename radius_type::type radius_type; + using point_type = typename point_type::type; + using radius_type = typename radius_type::type; template @@ -46,10 +47,10 @@ class ConstNsphere { static void apply() { - typedef typename coordinate_type::type coordinate_type; - const Geometry* s = 0; - coordinate_type coord(geometry::get(*s)); - boost::ignore_unused(coord); + using coordinate_type = typename coordinate_type::type; + const Geometry* s = nullptr; + static_assert(std::is_convertible(*s))>::value, + "coordinate_type must be initialisable from get(const Geometry&)"); dimension_checker::apply(); } }; @@ -64,14 +65,14 @@ public : BOOST_CONCEPT_USAGE(ConstNsphere) { - static const size_t n = dimension::value; + constexpr size_t n = dimension::value; dimension_checker<0, n>::apply(); dimension_checker<0, n>::apply(); // Check radius access - Geometry const* s = 0; - radius_type coord(geometry::get_radius<0>(*s)); - boost::ignore_unused(coord); + Geometry const* s = nullptr; + static_assert(std::is_convertible(*s))>::value, + "radius_type must be initialisable from get_radius<0>(const Geometry&)"); } }; @@ -85,8 +86,8 @@ class Nsphere { BOOST_CONCEPT_ASSERT( (concepts::ConstNsphere) ); - typedef typename point_type::type point_type; - typedef typename radius_type::type radius_type; + using point_type = typename point_type::type; + using radius_type = typename radius_type::type; template @@ -94,7 +95,7 @@ class Nsphere { static void apply() { - Geometry* s; + Geometry* s = nullptr; geometry::set(*s, geometry::get(*s)); dimension_checker::apply(); } @@ -115,7 +116,7 @@ public : dimension_checker<0, n>::apply(); // Check radius access - Geometry* s = 0; + Geometry* s = nullptr; set_radius<0>(*s, get_radius<0>(*s)); } }; diff --git a/include/boost/geometry/extensions/nsphere/index/detail/algorithms/content.hpp b/include/boost/geometry/extensions/nsphere/index/detail/algorithms/content.hpp index 7762c6ac18..84d8926a61 100644 --- a/include/boost/geometry/extensions/nsphere/index/detail/algorithms/content.hpp +++ b/include/boost/geometry/extensions/nsphere/index/detail/algorithms/content.hpp @@ -26,7 +26,7 @@ namespace dispatch { template struct content_nsphere { - BOOST_STATIC_ASSERT(2 < Dimension); + static_assert(2 < Dimension, "Dimension must be greater than 2"); typedef typename detail::default_content_result::type result_type; diff --git a/include/boost/geometry/extensions/nsphere/index/detail/algorithms/margin.hpp b/include/boost/geometry/extensions/nsphere/index/detail/algorithms/margin.hpp index c4d8b039a0..2d57abd53d 100644 --- a/include/boost/geometry/extensions/nsphere/index/detail/algorithms/margin.hpp +++ b/include/boost/geometry/extensions/nsphere/index/detail/algorithms/margin.hpp @@ -18,7 +18,7 @@ namespace boost { namespace geometry { namespace index { namespace detail { template struct comparable_margin_nsphere { - BOOST_STATIC_ASSERT(1 < Dimension); + static_assert(1 < Dimension, "Dimension must be greater than 1"); //BOOST_STATIC_ASSERT(Dimension <= dimension::value); static inline typename default_margin_result::type apply(NSphere const& s) diff --git a/include/boost/geometry/extensions/nsphere/index/detail/rtree/linear/redistribute_elements.hpp b/include/boost/geometry/extensions/nsphere/index/detail/rtree/linear/redistribute_elements.hpp index 544afec7c7..ab11778b24 100644 --- a/include/boost/geometry/extensions/nsphere/index/detail/rtree/linear/redistribute_elements.hpp +++ b/include/boost/geometry/extensions/nsphere/index/detail/rtree/linear/redistribute_elements.hpp @@ -16,10 +16,9 @@ #ifndef BOOST_GEOMETRY_EXTENSIONS_NSPHERE_INDEX_DETAIL_RTREE_LINEAR_REDISTRIBUTE_ELEMENTS_HPP #define BOOST_GEOMETRY_EXTENSIONS_NSPHERE_INDEX_DETAIL_RTREE_LINEAR_REDISTRIBUTE_ELEMENTS_HPP +#include #include -#include - #include namespace boost { namespace geometry { namespace index { @@ -107,7 +106,7 @@ struct find_greatest_normalized_separation +#include #include #include @@ -108,9 +108,7 @@ public : inline typename calculation_type::type apply_point_point(Point1 const& p1, Point2 const& p2) const { - Strategy point_point_strategy; - boost::ignore_unused(point_point_strategy); - return point_point_strategy.apply(p1, p2); + return Strategy().apply(p1, p2); } template @@ -151,8 +149,8 @@ public : result.on_segment = c1 >= zero && c1 <= c2; - Strategy point_point_strategy; - boost::ignore_unused(point_point_strategy); + static_assert(std::is_default_constructible::value, + "Strategy must be default constructible"); if (geometry::math::equals(c2, zero)) { diff --git a/include/boost/geometry/geometries/adapted/boost_fusion.hpp b/include/boost/geometry/geometries/adapted/boost_fusion.hpp index b73b7ad58a..af5134ee8d 100644 --- a/include/boost/geometry/geometries/adapted/boost_fusion.hpp +++ b/include/boost/geometry/geometries/adapted/boost_fusion.hpp @@ -34,8 +34,6 @@ #include #include -#include - #include #include #include @@ -57,7 +55,7 @@ struct all_same : bool, boost::mpl::count_if< Sequence, - boost::is_same< + std::is_same< typename boost::mpl::front::type, boost::mpl::_ > diff --git a/include/boost/geometry/geometries/concepts/box_concept.hpp b/include/boost/geometry/geometries/concepts/box_concept.hpp index 491446a22b..1c97d52acc 100644 --- a/include/boost/geometry/geometries/concepts/box_concept.hpp +++ b/include/boost/geometry/geometries/concepts/box_concept.hpp @@ -18,7 +18,6 @@ #include #include -#include #include #include @@ -46,7 +45,7 @@ class Box { static void apply() { - Geometry* b = 0; + Geometry* b = nullptr; geometry::set(*b, geometry::get(*b)); dimension_checker::apply(); } @@ -92,9 +91,12 @@ class ConstBox { static void apply() { - const Geometry* b = 0; - coordinate_type coord(geometry::get(*b)); - boost::ignore_unused(coord); + const Geometry* b = nullptr; + static_assert(std::is_constructible + < + coordinate_type, + decltype(geometry::get(*b)) + >::value, "coordinate_type must be constructible from get(*b)"); dimension_checker::apply(); } }; diff --git a/include/boost/geometry/geometries/concepts/linestring_concept.hpp b/include/boost/geometry/geometries/concepts/linestring_concept.hpp index 7a322aa531..892f69785c 100644 --- a/include/boost/geometry/geometries/concepts/linestring_concept.hpp +++ b/include/boost/geometry/geometries/concepts/linestring_concept.hpp @@ -48,10 +48,10 @@ public : BOOST_CONCEPT_USAGE(Linestring) { - Geometry* ls = 0; + Geometry* ls = nullptr; traits::clear::apply(*ls); traits::resize::apply(*ls, 0); - point_type* point = 0; + point_type* point = nullptr; traits::push_back::apply(*ls, *point); } #endif diff --git a/include/boost/geometry/geometries/concepts/multi_linestring_concept.hpp b/include/boost/geometry/geometries/concepts/multi_linestring_concept.hpp index 837b905fd6..184a70b7cd 100644 --- a/include/boost/geometry/geometries/concepts/multi_linestring_concept.hpp +++ b/include/boost/geometry/geometries/concepts/multi_linestring_concept.hpp @@ -45,10 +45,10 @@ public : BOOST_CONCEPT_USAGE(MultiLinestring) { - Geometry* mls = 0; + Geometry* mls = nullptr; traits::clear::apply(*mls); traits::resize::apply(*mls, 0); - linestring_type* ls = 0; + linestring_type* ls = nullptr; traits::push_back::apply(*mls, std::move(*ls)); } #endif diff --git a/include/boost/geometry/geometries/concepts/multi_point_concept.hpp b/include/boost/geometry/geometries/concepts/multi_point_concept.hpp index 23534deee8..db86c4cf07 100644 --- a/include/boost/geometry/geometries/concepts/multi_point_concept.hpp +++ b/include/boost/geometry/geometries/concepts/multi_point_concept.hpp @@ -47,10 +47,10 @@ public : BOOST_CONCEPT_USAGE(MultiPoint) { - Geometry* mp = 0; + Geometry* mp = nullptr; traits::clear::apply(*mp); traits::resize::apply(*mp, 0); - point_type* point = 0; + point_type* point = nullptr; traits::push_back::apply(*mp, *point); } #endif diff --git a/include/boost/geometry/geometries/concepts/multi_polygon_concept.hpp b/include/boost/geometry/geometries/concepts/multi_polygon_concept.hpp index aa907f8daa..3736281bd4 100644 --- a/include/boost/geometry/geometries/concepts/multi_polygon_concept.hpp +++ b/include/boost/geometry/geometries/concepts/multi_polygon_concept.hpp @@ -45,11 +45,11 @@ public : BOOST_CONCEPT_USAGE(MultiPolygon) { - Geometry* mp = 0; + Geometry* mp = nullptr; traits::clear::apply(*mp); traits::resize::apply(*mp, 0); // The concept should support the second version of push_back, using && - polygon_type* poly = 0; + polygon_type* poly = nullptr; traits::push_back::apply(*mp, std::move(*poly)); } #endif diff --git a/include/boost/geometry/geometries/concepts/point_concept.hpp b/include/boost/geometry/geometries/concepts/point_concept.hpp index bf05f02f72..e69e3b7127 100644 --- a/include/boost/geometry/geometries/concepts/point_concept.hpp +++ b/include/boost/geometry/geometries/concepts/point_concept.hpp @@ -21,9 +21,9 @@ #define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POINT_CONCEPT_HPP #include +#include #include -#include #include #include @@ -43,19 +43,15 @@ class Point using ctype = coordinate_type_t; using csystem = coordinate_system_t; - // The following enum is used to fully instantiate the coordinate - // system class; this is needed in order to check the units passed - // to it for non-Cartesian coordinate systems. - enum { cs_check = sizeof(csystem) }; - - enum { ccount = dimension::value }; + static_assert(sizeof(csystem) > 0, "coordinate_system_t can not be instantiated"); + static_assert(dimension::value > 0, "dimension::value must be positive"); template struct dimension_checker { static void apply() { - P* p = 0; + P* p = nullptr; geometry::set(*p, geometry::get(*p)); dimension_checker::apply(); } @@ -73,7 +69,7 @@ class Point /// BCCL macro to apply the Point concept BOOST_CONCEPT_USAGE(Point) { - dimension_checker::apply(); + dimension_checker::value>::apply(); } #endif }; @@ -96,21 +92,21 @@ class ConstPoint using ctype = coordinate_type_t; using csystem = coordinate_system_t; - // The following enum is used to fully instantiate the coordinate - // system class; this is needed in order to check the units passed - // to it for non-Cartesian coordinate systems. - enum { cs_check = sizeof(csystem) }; - - enum { ccount = dimension::value }; + static_assert(sizeof(csystem) > 0, "coordinate_system_t can not be instantiated"); + static_assert(dimension::value > 0, "dimension::value must be positive"); template struct dimension_checker { static void apply() { - const P* p = 0; - ctype coord(geometry::get(*p)); - boost::ignore_unused(p, coord); + const P* p = nullptr; + static_assert(std::is_constructible + < + ctype, + decltype(geometry::get(*p)) + >::value, + "get(Geometry) must be assignable to coordinate_type_t"); dimension_checker::apply(); } }; @@ -127,7 +123,7 @@ class ConstPoint /// BCCL macro to apply the ConstPoint concept BOOST_CONCEPT_USAGE(ConstPoint) { - dimension_checker::apply(); + dimension_checker::value>::apply(); } #endif }; diff --git a/include/boost/geometry/geometries/concepts/polygon_concept.hpp b/include/boost/geometry/geometries/concepts/polygon_concept.hpp index 17eeae89ac..3ca8ba9f4e 100644 --- a/include/boost/geometry/geometries/concepts/polygon_concept.hpp +++ b/include/boost/geometry/geometries/concepts/polygon_concept.hpp @@ -21,7 +21,6 @@ #include #include -#include #include #include @@ -46,12 +45,12 @@ template class Polygon { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename std::remove_const::type polygon_type; + using polygon_type = typename std::remove_const::type; - typedef typename traits::ring_const_type::type ring_const_type; - typedef typename traits::ring_mutable_type::type ring_mutable_type; - typedef typename traits::interior_const_type::type interior_const_type; - typedef typename traits::interior_mutable_type::type interior_mutable_type; + using ring_const_type = typename traits::ring_const_type::type; + using ring_mutable_type = typename traits::ring_mutable_type::type; + using interior_const_type = typename traits::interior_const_type::type; + using interior_mutable_type = typename traits::interior_mutable_type::type; using point_type = point_type_t; using ring_type = ring_type_t; @@ -65,16 +64,32 @@ class Polygon { static inline void apply() { - polygon_type* poly = 0; - polygon_type const* cpoly = poly; - - ring_mutable_type e = traits::exterior_ring::get(*poly); - interior_mutable_type i = traits::interior_rings::get(*poly); - ring_const_type ce = traits::exterior_ring::get(*cpoly); - interior_const_type ci = traits::interior_rings::get(*cpoly); - - boost::ignore_unused(poly, cpoly); - boost::ignore_unused(e, i, ce, ci); + polygon_type* poly = nullptr; + polygon_type const* cpoly = nullptr; + static_assert(std::is_convertible + < + ring_mutable_type, + decltype(traits::exterior_ring::get(*poly)) + >::value, + "traits::exterior_ring::get(polygon_type&) must be convertible to ring_mutable_type"); + static_assert(std::is_convertible + < + interior_mutable_type, + decltype(traits::interior_rings::get(*poly)) + >::value, + "traits::interior_rings::get(polygon_type&) must be convertible to interior_mutable_type"); + static_assert(std::is_convertible + < + ring_const_type, + decltype(traits::exterior_ring::get(*cpoly)) + >::value, + "traits::exterior_ring::get(const polygon_type&) must be convertible to ring_const_type"); + static_assert(std::is_convertible + < + interior_const_type, + decltype(traits::interior_rings::get(*cpoly)) + >::value, + "traits::interior_rings::get(const polygon_type&) must be convertible to interior_const_type"); } }; @@ -97,10 +112,10 @@ class ConstPolygon { #ifndef DOXYGEN_NO_CONCEPT_MEMBERS - typedef typename std::remove_const::type const_polygon_type; + using const_polygon_type = typename std::remove_const::type; - typedef typename traits::ring_const_type::type ring_const_type; - typedef typename traits::interior_const_type::type interior_const_type; + using ring_const_type = typename traits::ring_const_type::type; + using interior_const_type = typename traits::interior_const_type::type; using point_type = point_type_t; using ring_type = ring_type_t; @@ -114,12 +129,19 @@ class ConstPolygon { static inline void apply() { - const_polygon_type const* cpoly = 0; - - ring_const_type ce = traits::exterior_ring::get(*cpoly); - interior_const_type ci = traits::interior_rings::get(*cpoly); - - boost::ignore_unused(ce, ci, cpoly); + const_polygon_type const* cpoly = nullptr; + static_assert(std::is_convertible + < + ring_const_type, + decltype(traits::exterior_ring::get(*cpoly)) + >::value, + "traits::exterior_ring::get(const polygon_type&) must be convertible to ring_const_type"); + static_assert(std::is_convertible + < + interior_const_type, + decltype(traits::interior_rings::get(*cpoly)) + >::value, + "traits::interior_rings::get(const polygon_type&) must be convertible to interior_const_type"); } }; diff --git a/include/boost/geometry/geometries/concepts/polyhedral_surface_concept.hpp b/include/boost/geometry/geometries/concepts/polyhedral_surface_concept.hpp index a78403a609..637f86b76e 100644 --- a/include/boost/geometry/geometries/concepts/polyhedral_surface_concept.hpp +++ b/include/boost/geometry/geometries/concepts/polyhedral_surface_concept.hpp @@ -34,11 +34,11 @@ class PolyhedralSurface BOOST_CONCEPT_USAGE(PolyhedralSurface) { - Geometry* ps = 0; + Geometry* ps = nullptr; traits::clear::apply(*ps); traits::resize::apply(*ps, 0); // The concept should support the second version of push_back, using && - polygon_type* poly = 0; + polygon_type* poly = nullptr; traits::push_back::apply(*ps, std::move(*poly)); } #endif diff --git a/include/boost/geometry/geometries/concepts/ring_concept.hpp b/include/boost/geometry/geometries/concepts/ring_concept.hpp index ba2cc4ea6b..a7846b7260 100644 --- a/include/boost/geometry/geometries/concepts/ring_concept.hpp +++ b/include/boost/geometry/geometries/concepts/ring_concept.hpp @@ -47,10 +47,10 @@ public : BOOST_CONCEPT_USAGE(Ring) { - Geometry* ring = 0; + Geometry* ring = nullptr; traits::clear::apply(*ring); traits::resize::apply(*ring, 0); - point_type* point = 0; + point_type* point = nullptr; traits::push_back::apply(*ring, *point); } #endif diff --git a/include/boost/geometry/geometries/concepts/segment_concept.hpp b/include/boost/geometry/geometries/concepts/segment_concept.hpp index c2bc332fd5..9693b43ac6 100644 --- a/include/boost/geometry/geometries/concepts/segment_concept.hpp +++ b/include/boost/geometry/geometries/concepts/segment_concept.hpp @@ -20,7 +20,6 @@ #include -#include #include #include @@ -46,7 +45,7 @@ class Segment { static void apply() { - Geometry* s = 0; + Geometry* s = nullptr; geometry::set(*s, geometry::get(*s)); dimension_checker::apply(); } @@ -91,9 +90,9 @@ class ConstSegment { static void apply() { - const Geometry* s = 0; - coordinate_type coord(geometry::get(*s)); - boost::ignore_unused(coord); + const Geometry* s = nullptr; + static_assert(std::is_constructible(s))>::value, + "Return type of get(const Geometry) must be convertible to coordinate_type."); dimension_checker::apply(); } }; diff --git a/include/boost/geometry/geometries/point.hpp b/include/boost/geometry/geometries/point.hpp index 9ca7c65899..e0b596a945 100644 --- a/include/boost/geometry/geometries/point.hpp +++ b/include/boost/geometry/geometries/point.hpp @@ -23,8 +23,6 @@ #include #include -#include - #include #include #include @@ -95,7 +93,7 @@ template > class point { - BOOST_STATIC_ASSERT(DimensionCount > 0); + static_assert(DimensionCount > 0, "DimensionCount must be positive"); // The following enum is used to fully instantiate the // CoordinateSystem class and check the correctness of the units @@ -197,7 +195,7 @@ class point BOOST_GEOMETRY_ASSERT(m_created == 1); BOOST_GEOMETRY_ASSERT(m_values_initialized[K] == 1); #endif - BOOST_STATIC_ASSERT(K < DimensionCount); + static_assert(K < DimensionCount, "K must be < DimensionCount"); return m_values[K]; } @@ -211,7 +209,7 @@ class point BOOST_GEOMETRY_ASSERT(m_created == 1); m_values_initialized[K] = 1; #endif - BOOST_STATIC_ASSERT(K < DimensionCount); + static_assert(K < DimensionCount, "K must be < DimensionCount"); m_values[K] = value; } diff --git a/include/boost/geometry/index/detail/algorithms/content.hpp b/include/boost/geometry/index/detail/algorithms/content.hpp index 2134263a13..ab73d5521c 100644 --- a/include/boost/geometry/index/detail/algorithms/content.hpp +++ b/include/boost/geometry/index/detail/algorithms/content.hpp @@ -42,7 +42,7 @@ template ::value> struct content_box { - BOOST_STATIC_ASSERT(0 < CurrentDimension); + static_assert(0 < CurrentDimension, "CurrentDimension must be positive"); static inline typename detail::default_content_result::type apply(Box const& b) { diff --git a/include/boost/geometry/index/detail/algorithms/margin.hpp b/include/boost/geometry/index/detail/algorithms/margin.hpp index 8a4f9fda3b..2a1140d0ee 100644 --- a/include/boost/geometry/index/detail/algorithms/margin.hpp +++ b/include/boost/geometry/index/detail/algorithms/margin.hpp @@ -115,7 +115,7 @@ template ::value> struct simple_margin_for_each_dimension { - BOOST_STATIC_ASSERT(0 < CurrentDimension); + static_assert(0 < CurrentDimension, "CurrentDimension must be positive"); static inline typename default_margin_result::type apply(Box const& b) { diff --git a/include/boost/geometry/index/detail/algorithms/segment_intersection.hpp b/include/boost/geometry/index/detail/algorithms/segment_intersection.hpp index bed19ff258..9e6138b080 100644 --- a/include/boost/geometry/index/detail/algorithms/segment_intersection.hpp +++ b/include/boost/geometry/index/detail/algorithms/segment_intersection.hpp @@ -47,11 +47,11 @@ namespace dispatch { template struct box_segment_intersection_dim { - BOOST_STATIC_ASSERT(0 <= dimension::value); - BOOST_STATIC_ASSERT(0 <= dimension::value); - BOOST_STATIC_ASSERT(I < size_t(dimension::value)); - BOOST_STATIC_ASSERT(I < size_t(dimension::value)); - BOOST_STATIC_ASSERT(dimension::value == dimension::value); + static_assert(0 <= dimension::value, "dimension::value must not be negative"); + static_assert(0 <= dimension::value, "dimension::value must not be negative"); + static_assert(I < size_t(dimension::value), "I must be smaller than dimension::value"); + static_assert(I < size_t(dimension::value), "I must be smaller than dimension::value"); + static_assert(dimension::value == dimension::value, "Point and Box must have the same dimension"); // WARNING! - RelativeDistance must be IEEE float for this to work @@ -77,9 +77,9 @@ struct box_segment_intersection_dim template struct box_segment_intersection { - BOOST_STATIC_ASSERT(0 < CurrentDimension); + static_assert(0 < CurrentDimension, "CurrentDimension must be positive"); - typedef box_segment_intersection_dim for_dim; + using for_dim = box_segment_intersection_dim; template static inline bool apply(Box const& b, Point const& p0, Point const& p1, diff --git a/include/boost/geometry/index/detail/algorithms/smallest_for_indexable.hpp b/include/boost/geometry/index/detail/algorithms/smallest_for_indexable.hpp index fb356e3d23..7aea6d3572 100644 --- a/include/boost/geometry/index/detail/algorithms/smallest_for_indexable.hpp +++ b/include/boost/geometry/index/detail/algorithms/smallest_for_indexable.hpp @@ -15,6 +15,8 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SMALLEST_FOR_INDEXABLE_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SMALLEST_FOR_INDEXABLE_HPP +#include + #include namespace boost { namespace geometry { namespace index { namespace detail { @@ -24,7 +26,7 @@ template < typename Indexable, typename IndexableTag, typename AlgoTag, - size_t DimensionIndex> + std::size_t DimensionIndex> struct smallest_for_indexable_dimension { BOOST_GEOMETRY_STATIC_ASSERT_FALSE( @@ -37,7 +39,7 @@ template < typename Indexable, typename IndexableTag, typename AlgoTag, - size_t N> + std::size_t N> struct smallest_for_indexable { typedef typename smallest_for_indexable_dimension< diff --git a/include/boost/geometry/index/detail/algorithms/sum_for_indexable.hpp b/include/boost/geometry/index/detail/algorithms/sum_for_indexable.hpp index 3d284b9c84..5d750a9b44 100644 --- a/include/boost/geometry/index/detail/algorithms/sum_for_indexable.hpp +++ b/include/boost/geometry/index/detail/algorithms/sum_for_indexable.hpp @@ -15,6 +15,8 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SUM_FOR_INDEXABLE_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_SUM_FOR_INDEXABLE_HPP +#include + #include namespace boost { namespace geometry { namespace index { namespace detail { @@ -24,7 +26,7 @@ template < typename Indexable, typename IndexableTag, typename AlgoTag, - size_t DimensionIndex> + std::size_t DimensionIndex> struct sum_for_indexable_dimension { BOOST_GEOMETRY_STATIC_ASSERT_FALSE( @@ -37,7 +39,7 @@ template < typename Indexable, typename IndexableTag, typename AlgoTag, - size_t N> + std::size_t N> struct sum_for_indexable { typedef typename sum_for_indexable_dimension< diff --git a/include/boost/geometry/index/detail/rtree/iterators.hpp b/include/boost/geometry/index/detail/rtree/iterators.hpp index 5ab04a541c..4d607036c0 100644 --- a/include/boost/geometry/index/detail/rtree/iterators.hpp +++ b/include/boost/geometry/index/detail/rtree/iterators.hpp @@ -33,14 +33,14 @@ struct end_iterator reference operator*() const { BOOST_GEOMETRY_INDEX_ASSERT(false, "iterator not dereferencable"); - pointer p(0); + pointer p(nullptr); return *p; } const value_type * operator->() const { BOOST_GEOMETRY_INDEX_ASSERT(false, "iterator not dereferencable"); - const value_type * p = 0; + const value_type * p = nullptr; return p; } diff --git a/include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp b/include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp index 87f933f659..ea517aae10 100644 --- a/include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp +++ b/include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp @@ -18,8 +18,6 @@ #include -#include - #include #include @@ -178,8 +176,6 @@ struct find_greatest_normalized_separation seed1 = highest_low_index; seed2 = lowest_high_index; - - ::boost::ignore_unused(parameters); } }; @@ -233,15 +229,13 @@ struct find_greatest_normalized_separation struct pick_seeds_impl { - BOOST_STATIC_ASSERT(0 < Dimension); + static_assert(0 < Dimension, "Dimension must be positive"); using element_type = typename Elements::value_type; using indexable_type = typename rtree::element_indexable_type::type; diff --git a/include/boost/geometry/index/detail/rtree/pack_create.hpp b/include/boost/geometry/index/detail/rtree/pack_create.hpp index ee517ca996..e8119fd691 100644 --- a/include/boost/geometry/index/detail/rtree/pack_create.hpp +++ b/include/boost/geometry/index/detail/rtree/pack_create.hpp @@ -17,8 +17,6 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_PACK_CREATE_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_PACK_CREATE_HPP -#include - #include #include #include @@ -40,7 +38,7 @@ namespace pack_utils { template struct biggest_edge { - BOOST_STATIC_ASSERT(0 < Dimension); + static_assert(0 < Dimension, "Dimension must be positive"); template static inline void apply(Box const& box, coordinate_type_t & length, std::size_t & dim_index) { @@ -442,8 +440,6 @@ class pack inline static subtree_elements_counts calculate_subtree_elements_counts(size_type elements_count, parameters_type const& parameters, size_type & leafs_level) { - boost::ignore_unused(parameters); - subtree_elements_counts res(1, 1); leafs_level = 0; diff --git a/include/boost/geometry/index/detail/rtree/quadratic/redistribute_elements.hpp b/include/boost/geometry/index/detail/rtree/quadratic/redistribute_elements.hpp index 23de98c161..904c17877f 100644 --- a/include/boost/geometry/index/detail/rtree/quadratic/redistribute_elements.hpp +++ b/include/boost/geometry/index/detail/rtree/quadratic/redistribute_elements.hpp @@ -17,8 +17,6 @@ #include -#include - #include #include @@ -86,8 +84,6 @@ inline void pick_seeds(Elements const& elements, } } } - - ::boost::ignore_unused(parameters); } } // namespace quadratic diff --git a/include/boost/geometry/index/detail/rtree/query_iterators.hpp b/include/boost/geometry/index/detail/rtree/query_iterators.hpp index 170c3ac9b1..f4134f05a0 100644 --- a/include/boost/geometry/index/detail/rtree/query_iterators.hpp +++ b/include/boost/geometry/index/detail/rtree/query_iterators.hpp @@ -35,14 +35,14 @@ struct end_query_iterator reference operator*() const { BOOST_GEOMETRY_INDEX_ASSERT(false, "iterator not dereferencable"); - pointer p(0); + pointer p(nullptr); return *p; } const value_type * operator->() const { BOOST_GEOMETRY_INDEX_ASSERT(false, "iterator not dereferencable"); - const value_type * p = 0; + const value_type * p = nullptr; return p; } diff --git a/include/boost/geometry/index/detail/rtree/rstar/choose_next_node.hpp b/include/boost/geometry/index/detail/rtree/rstar/choose_next_node.hpp index 8032a2626e..2a04436ac8 100644 --- a/include/boost/geometry/index/detail/rtree/rstar/choose_next_node.hpp +++ b/include/boost/geometry/index/detail/rtree/rstar/choose_next_node.hpp @@ -17,8 +17,6 @@ #include -#include - #include #include @@ -57,8 +55,6 @@ class choose_next_node parameters_type const& parameters, size_t node_relative_level) { - ::boost::ignore_unused(parameters); - children_type & children = rtree::elements(n); // children are leafs diff --git a/include/boost/geometry/index/detail/rtree/rstar/insert.hpp b/include/boost/geometry/index/detail/rtree/rstar/insert.hpp index b3ad01c345..3b2ecfd084 100644 --- a/include/boost/geometry/index/detail/rtree/rstar/insert.hpp +++ b/include/boost/geometry/index/detail/rtree/rstar/insert.hpp @@ -16,10 +16,9 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_RSTAR_INSERT_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_RSTAR_INSERT_HPP +#include #include -#include - #include #include @@ -176,8 +175,6 @@ class remove_elements_to_reinsert BOOST_RETHROW // RETHROW } BOOST_CATCH_END - - ::boost::ignore_unused(parameters); } private: @@ -580,7 +577,7 @@ class insert inline void operator()(internal_node & n) { - boost::ignore_unused(n); + std::ignore = n; BOOST_GEOMETRY_INDEX_ASSERT(&n == &rtree::get(*m_root), "current node should be the root"); // Distinguish between situation when reinserts are required and use adequate visitor, otherwise use default one @@ -607,7 +604,7 @@ class insert inline void operator()(leaf & n) { - boost::ignore_unused(n); + std::ignore = n; BOOST_GEOMETRY_INDEX_ASSERT(&n == &rtree::get(*m_root), "current node should be the root"); // Distinguish between situation when reinserts are required and use adequate visitor, otherwise use default one diff --git a/include/boost/geometry/index/detail/rtree/rstar/redistribute_elements.hpp b/include/boost/geometry/index/detail/rtree/rstar/redistribute_elements.hpp index 8d1a25548e..5f4253c0fa 100644 --- a/include/boost/geometry/index/detail/rtree/rstar/redistribute_elements.hpp +++ b/include/boost/geometry/index/detail/rtree/rstar/redistribute_elements.hpp @@ -15,8 +15,6 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_RSTAR_REDISTRIBUTE_ELEMENTS_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_RSTAR_REDISTRIBUTE_ELEMENTS_HPP -#include - #include #include @@ -181,8 +179,6 @@ struct choose_split_axis_and_index_for_corner smallest_content = con; } } - - ::boost::ignore_unused(parameters); } }; @@ -275,7 +271,7 @@ struct choose_split_axis_and_index_for_axis template struct choose_split_axis_and_index { - BOOST_STATIC_ASSERT(0 < Dimension); + static_assert(0 < Dimension, "Dimension must be positive"); typedef typename index::detail::default_margin_result::type margin_type; typedef typename index::detail::default_content_result::type content_type; @@ -360,8 +356,8 @@ struct choose_split_axis_and_index template struct nth_element { - BOOST_STATIC_ASSERT(0 < Dimension); - BOOST_STATIC_ASSERT(I < Dimension); + static_assert(0 < Dimension, "Dimension must be positive"); + static_assert(I < Dimension, "Dimension must be greater than I"); template static inline void apply(Elements & elements, Parameters const& parameters, diff --git a/include/boost/geometry/index/detail/rtree/utilities/print.hpp b/include/boost/geometry/index/detail/rtree/utilities/print.hpp index 5d8f21612f..e8bc7e6564 100644 --- a/include/boost/geometry/index/detail/rtree/utilities/print.hpp +++ b/include/boost/geometry/index/detail/rtree/utilities/print.hpp @@ -37,7 +37,7 @@ namespace dispatch { template struct print_point { - BOOST_STATIC_ASSERT(0 < Dimension); + static_assert(0 < Dimension, "Dimension must be positive"); static inline void apply(std::ostream & os, Point const& p) { @@ -59,7 +59,7 @@ struct print_point template struct print_corner { - BOOST_STATIC_ASSERT(0 < Dimension); + static_assert(0 < Dimension, "Dimension must be positive"); static inline void apply(std::ostream & os, Box const& b) { diff --git a/include/boost/geometry/index/detail/rtree/visitors/destroy.hpp b/include/boost/geometry/index/detail/rtree/visitors/destroy.hpp index f217a4ab1b..71ea1d83be 100644 --- a/include/boost/geometry/index/detail/rtree/visitors/destroy.hpp +++ b/include/boost/geometry/index/detail/rtree/visitors/destroy.hpp @@ -16,6 +16,8 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_DELETE_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_DELETE_HPP +#include + #include #include #include @@ -63,7 +65,7 @@ class destroy inline void operator()(leaf & l) { - boost::ignore_unused(l); + std::ignore = l; BOOST_GEOMETRY_INDEX_ASSERT(&l == &rtree::get(*m_current_node), "invalid pointers"); rtree::destroy_node::apply(m_allocators, m_current_node); diff --git a/include/boost/geometry/index/detail/varray.hpp b/include/boost/geometry/index/detail/varray.hpp index 4d010cb828..c1e399995f 100644 --- a/include/boost/geometry/index/detail/varray.hpp +++ b/include/boost/geometry/index/detail/varray.hpp @@ -14,14 +14,15 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_VARRAY_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_VARRAY_HPP +#include +#include + // TODO - REMOVE/CHANGE #include #include #include #include -#include -#include // TODO - use std::reverse_iterator and std::iterator_traits // instead Boost.Iterator to remove dependency? @@ -72,8 +73,9 @@ struct checker static inline void check_capacity(Varray const& v, size_type s) { BOOST_GEOMETRY_INDEX_ASSERT(s <= v.capacity(), "size too big"); - - ::boost::ignore_unused(v, s); + + std::ignore = v; + std::ignore = s; } static inline void throw_out_of_bounds(Varray const& v, size_type i) @@ -81,35 +83,38 @@ struct checker if ( v.size() <= i ) throw_out_of_range("index out of bounds"); - ::boost::ignore_unused(v, i); + std::ignore = v; + std::ignore = i; } static inline void check_index(Varray const& v, size_type i) { BOOST_GEOMETRY_INDEX_ASSERT(i < v.size(), "index out of bounds"); - ::boost::ignore_unused(v, i); + std::ignore = v; + std::ignore = i; } static inline void check_not_empty(Varray const& v) { BOOST_GEOMETRY_INDEX_ASSERT(!v.empty(), "the container is empty"); - ::boost::ignore_unused(v); + std::ignore = v; } static inline void check_iterator_end_neq(Varray const& v, const_iterator position) { BOOST_GEOMETRY_INDEX_ASSERT(v.begin() <= position && position < v.end(), "iterator out of bounds"); - ::boost::ignore_unused(v, position); + std::ignore = v; } static inline void check_iterator_end_eq(Varray const& v, const_iterator position) { BOOST_GEOMETRY_INDEX_ASSERT(v.begin() <= position && position <= v.end(), "iterator out of bounds"); - ::boost::ignore_unused(v, position); + std::ignore = v; + std::ignore = position; } }; @@ -154,7 +159,7 @@ class varray BOOST_GEOMETRY_STATIC_ASSERT( ( std::is_unsigned::value && - sizeof(typename boost::uint_value_t::least) <= sizeof(typename vt::size_type) ), + Capacity <= std::numeric_limits::max() ), "Size type is too small for specified capacity.", typename vt::size_type, std::integral_constant ); diff --git a/include/boost/geometry/io/svg/svg_mapper.hpp b/include/boost/geometry/io/svg/svg_mapper.hpp index fdfa7732d0..93a00a54ef 100644 --- a/include/boost/geometry/io/svg/svg_mapper.hpp +++ b/include/boost/geometry/io/svg/svg_mapper.hpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include @@ -264,7 +263,7 @@ template bool SameScale = true, typename SvgCoordinateType = double > -class svg_mapper : boost::noncopyable +class svg_mapper { typedef model::point svg_point_type; @@ -385,6 +384,9 @@ public : write_header(width_height); } + svg_mapper(const svg_mapper&) = delete; + svg_mapper& operator=(const svg_mapper&) = delete; + /*! \brief Destructor, called automatically. Closes the SVG by streaming <\/svg> */ diff --git a/include/boost/geometry/io/wkt/read.hpp b/include/boost/geometry/io/wkt/read.hpp index e8db2b464a..b2cd0f1936 100644 --- a/include/boost/geometry/io/wkt/read.hpp +++ b/include/boost/geometry/io/wkt/read.hpp @@ -275,7 +275,7 @@ struct stateful_range_appender using point_type = geometry::point_type_t; using size_type = typename boost::range_size>::type; - BOOST_STATIC_ASSERT((util::is_ring::value)); + static_assert(util::is_ring::value, "Geometry must be ring"); inline stateful_range_appender() : pt_index(0) diff --git a/include/boost/geometry/srs/projections/impl/dms_parser.hpp b/include/boost/geometry/srs/projections/impl/dms_parser.hpp index 02e26b7287..a342340562 100644 --- a/include/boost/geometry/srs/projections/impl/dms_parser.hpp +++ b/include/boost/geometry/srs/projections/impl/dms_parser.hpp @@ -44,8 +44,6 @@ #include #include -#include - #include #include #include @@ -104,7 +102,7 @@ struct dms_parser // For now: make it (compile-time) case sensitive static const int diff = 'a' - 'A'; #ifndef __GNUC__ - BOOST_STATIC_ASSERT((diff > 0)); // make sure we've the right assumption. GCC does not accept this here. + static_assert(diff > 0, "diff must be > 0"); // make sure we've the right assumption. GCC does not accept this here. #endif static const char n_alter = N <= 'Z' ? N + diff : N - diff; static const char e_alter = E <= 'Z' ? E + diff : E - diff; diff --git a/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp b/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp index 2822fe6959..b88cdc4571 100644 --- a/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp @@ -43,14 +43,13 @@ #define BOOST_GEOMETRY_SRS_PROJECTIONS_IMPL_PJ_GRIDINFO_HPP -#include #include #include #include -#include #include +#include #include #include @@ -106,7 +105,7 @@ struct pj_ctable { struct lp_t { double lam, phi; }; struct flp_t { float lam, phi; }; - struct ilp_t { boost::int32_t lam, phi; }; + struct ilp_t { std::int32_t lam, phi; }; std::string id; // ascii info lp_t ll; // lower left corner coordinates @@ -127,7 +126,7 @@ struct pj_ctable struct pj_gi_load { enum format_t { missing = 0, ntv1, ntv2, gtx, ctable, ctable2 }; - typedef boost::long_long_type offset_t; + using offset_t = std::intmax_t; explicit pj_gi_load(std::string const& gname = "", format_t f = missing, @@ -277,7 +276,7 @@ inline bool pj_gridinfo_load_ntv1(IStream & is, pj_gi_load & gi) std::vector row_buf(r_size); gi.ct.cvs.resize(gi.ct.lim.lam * gi.ct.lim.phi); - for (boost::int32_t row = 0; row < gi.ct.lim.phi; row++ ) + for (std::int32_t row = 0; row < gi.ct.lim.phi; row++ ) { is.read(reinterpret_cast(&row_buf[0]), ch_size); @@ -291,7 +290,7 @@ inline bool pj_gridinfo_load_ntv1(IStream & is, pj_gi_load & gi) swap_words(reinterpret_cast(&row_buf[0]), 8, (int)r_size); // convert seconds to radians - for (boost::int32_t i = 0; i < gi.ct.lim.lam; i++ ) + for (std::int32_t i = 0; i < gi.ct.lim.lam; i++ ) { pj_ctable::flp_t & cvs = gi.ct.cvs[row * gi.ct.lim.lam + (gi.ct.lim.lam - i - 1)]; @@ -327,7 +326,7 @@ inline bool pj_gridinfo_load_ntv2(IStream & is, pj_gi_load & gi) std::vector row_buf(r_size); gi.ct.cvs.resize(gi.ct.lim.lam * gi.ct.lim.phi); - for (boost::int32_t row = 0; row < gi.ct.lim.phi; row++ ) + for (std::int32_t row = 0; row < gi.ct.lim.phi; row++ ) { is.read(reinterpret_cast(&row_buf[0]), ch_size); @@ -343,7 +342,7 @@ inline bool pj_gridinfo_load_ntv2(IStream & is, pj_gi_load & gi) } // convert seconds to radians - for (boost::int32_t i = 0; i < gi.ct.lim.lam; i++ ) + for (std::int32_t i = 0; i < gi.ct.lim.lam; i++ ) { pj_ctable::flp_t & cvs = gi.ct.cvs[row * gi.ct.lim.lam + (gi.ct.lim.lam - i - 1)]; @@ -366,7 +365,7 @@ inline bool pj_gridinfo_load_ntv2(IStream & is, pj_gi_load & gi) template inline bool pj_gridinfo_load_gtx(IStream & is, pj_gi_load & gi) { - boost::int32_t words = gi.ct.lim.lam * gi.ct.lim.phi; + std::int32_t words = gi.ct.lim.lam * gi.ct.lim.phi; std::size_t const ch_size = sizeof(float) * words; is.seekg(gi.grid_offset); @@ -477,8 +476,8 @@ inline bool pj_gridinfo_init_ntv2(std::string const& gridname, IStream & is, pj_gridinfo & gridinfo) { - BOOST_STATIC_ASSERT( sizeof(boost::int32_t) == 4 ); - BOOST_STATIC_ASSERT( sizeof(double) == 8 ); + static_assert( sizeof(std::int32_t) == 4, "sizeof(std::int32_t) must be 4" ); + static_assert( sizeof(double) == 8, "sizeof(double) must be 8"); static const double s2r = math::d2r() / 3600.0; @@ -516,11 +515,11 @@ inline bool pj_gridinfo_init_ntv2(std::string const& gridname, } // Get the subfile count out ... all we really use for now. - boost::int32_t num_subfiles; + std::int32_t num_subfiles; memcpy( &num_subfiles, header+8+32, 4 ); // Step through the subfiles, creating a PJ_GRIDINFO for each. - for( boost::int32_t subfile = 0; subfile < num_subfiles; subfile++ ) + for( std::int32_t subfile = 0; subfile < num_subfiles; subfile++ ) { // Read header. is.read(header, sizeof(header)); @@ -561,15 +560,15 @@ inline bool pj_gridinfo_init_ntv2(std::string const& gridname, ct.del.lam = *((double *) (header+9*16+8)); ct.del.phi = *((double *) (header+8*16+8)); - ct.lim.lam = (boost::int32_t) (fabs(ur.lam-ct.ll.lam)/ct.del.lam + 0.5) + 1; - ct.lim.phi = (boost::int32_t) (fabs(ur.phi-ct.ll.phi)/ct.del.phi + 0.5) + 1; + ct.lim.lam = (std::int32_t) (fabs(ur.lam-ct.ll.lam)/ct.del.lam + 0.5) + 1; + ct.lim.phi = (std::int32_t) (fabs(ur.phi-ct.ll.phi)/ct.del.phi + 0.5) + 1; ct.ll.lam *= s2r; ct.ll.phi *= s2r; ct.del.lam *= s2r; ct.del.phi *= s2r; - boost::int32_t gs_count; + std::int32_t gs_count; memcpy( &gs_count, header + 8 + 16*10, 4 ); if( gs_count != ct.lim.lam * ct.lim.phi ) { @@ -629,8 +628,8 @@ inline bool pj_gridinfo_init_ntv1(std::string const& gridname, IStream & is, pj_gridinfo & gridinfo) { - BOOST_STATIC_ASSERT( sizeof(boost::int32_t) == 4 ); - BOOST_STATIC_ASSERT( sizeof(double) == 8 ); + static_assert( sizeof(std::int32_t) == 4, "sizeof(std::int32_t) must be 4" ); + static_assert( sizeof(double) == 8, "sizeof(double) must be 8"); static const double d2r = math::d2r(); @@ -656,7 +655,7 @@ inline bool pj_gridinfo_init_ntv1(std::string const& gridname, } // NTv1 grid shift file has wrong record count, corrupt? - if( *((boost::int32_t *) (header+8)) != 12 ) + if( *((std::int32_t *) (header+8)) != 12 ) { return false; } @@ -679,8 +678,8 @@ inline bool pj_gridinfo_init_ntv1(std::string const& gridname, ur.phi = *((double *) (header+40)); ct.del.lam = *((double *) (header+104)); ct.del.phi = *((double *) (header+88)); - ct.lim.lam = (boost::int32_t) (fabs(ur.lam-ct.ll.lam)/ct.del.lam + 0.5) + 1; - ct.lim.phi = (boost::int32_t) (fabs(ur.phi-ct.ll.phi)/ct.del.phi + 0.5) + 1; + ct.lim.lam = (std::int32_t) (fabs(ur.lam-ct.ll.lam)/ct.del.lam + 0.5) + 1; + ct.lim.phi = (std::int32_t) (fabs(ur.phi-ct.ll.phi)/ct.del.phi + 0.5) + 1; ct.ll.lam *= d2r; ct.ll.phi *= d2r; @@ -706,8 +705,8 @@ inline bool pj_gridinfo_init_gtx(std::string const& gridname, IStream & is, pj_gridinfo & gridinfo) { - BOOST_STATIC_ASSERT( sizeof(boost::int32_t) == 4 ); - BOOST_STATIC_ASSERT( sizeof(double) == 8 ); + static_assert( sizeof(std::int32_t) == 4, "sizeof(std::int32_t) must be 4" ); + static_assert( sizeof(double) == 8, "sizeof(double) must be 8"); static const double d2r = math::d2r(); @@ -722,7 +721,7 @@ inline bool pj_gridinfo_init_gtx(std::string const& gridname, // Regularize fields of interest and extract. double xorigin, yorigin, xstep, ystep; - boost::int32_t rows, columns; + std::int32_t rows, columns; if( is_lsb() ) { @@ -793,8 +792,8 @@ inline bool pj_gridinfo_init_ctable2(std::string const& gridname, IStream & is, pj_gridinfo & gridinfo) { - BOOST_STATIC_ASSERT( sizeof(boost::int32_t) == 4 ); - BOOST_STATIC_ASSERT( sizeof(double) == 8 ); + static_assert( sizeof(std::int32_t) == 4, "sizeof(std::int32_t) must be 4" ); + static_assert( sizeof(double) == 8, "sizeof(double) must be 8"); char header[160]; @@ -858,8 +857,8 @@ inline bool pj_gridinfo_init_ctable(std::string const& gridname, IStream & is, pj_gridinfo & gridinfo) { - BOOST_STATIC_ASSERT( sizeof(boost::int32_t) == 4 ); - BOOST_STATIC_ASSERT( sizeof(double) == 8 ); + static_assert( sizeof(std::int32_t) == 4, "sizeof(std::int32_t) must be 4" ); + static_assert( sizeof(double) == 8, "sizeof(double) must be 8"); // 80 + 2*8 + 2*8 + 2*4 char header[120]; diff --git a/include/boost/geometry/srs/projections/proj/aea.hpp b/include/boost/geometry/srs/projections/proj/aea.hpp index bf319618a5..6001ba8c13 100644 --- a/include/boost/geometry/srs/projections/proj/aea.hpp +++ b/include/boost/geometry/srs/projections/proj/aea.hpp @@ -47,7 +47,6 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_AEA_HPP #define BOOST_GEOMETRY_PROJECTIONS_AEA_HPP -#include #include #include diff --git a/include/boost/geometry/srs/projections/proj/aitoff.hpp b/include/boost/geometry/srs/projections/proj/aitoff.hpp index f11a46e9df..8a0d4c0077 100644 --- a/include/boost/geometry/srs/projections/proj/aitoff.hpp +++ b/include/boost/geometry/srs/projections/proj/aitoff.hpp @@ -47,8 +47,6 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_AITOFF_HPP #define BOOST_GEOMETRY_PROJECTIONS_AITOFF_HPP -#include - #include #include #include diff --git a/include/boost/geometry/srs/projections/proj/eck3.hpp b/include/boost/geometry/srs/projections/proj/eck3.hpp index 20c5bc1bb1..d698504360 100644 --- a/include/boost/geometry/srs/projections/proj/eck3.hpp +++ b/include/boost/geometry/srs/projections/proj/eck3.hpp @@ -40,8 +40,6 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_ECK3_HPP #define BOOST_GEOMETRY_PROJECTIONS_ECK3_HPP -#include - #include #include #include diff --git a/include/boost/geometry/srs/projections/proj/isea.hpp b/include/boost/geometry/srs/projections/proj/isea.hpp index f2984568c7..415908082c 100644 --- a/include/boost/geometry/srs/projections/proj/isea.hpp +++ b/include/boost/geometry/srs/projections/proj/isea.hpp @@ -45,8 +45,6 @@ #include -#include - #include #include diff --git a/include/boost/geometry/srs/projections/proj/qsc.hpp b/include/boost/geometry/srs/projections/proj/qsc.hpp index 733015e7f3..5d9379e911 100644 --- a/include/boost/geometry/srs/projections/proj/qsc.hpp +++ b/include/boost/geometry/srs/projections/proj/qsc.hpp @@ -77,7 +77,6 @@ #ifndef BOOST_GEOMETRY_PROJECTIONS_QSC_HPP #define BOOST_GEOMETRY_PROJECTIONS_QSC_HPP -#include #include #include diff --git a/include/boost/geometry/srs/projections/str_cast.hpp b/include/boost/geometry/srs/projections/str_cast.hpp index 70c6b6d1f7..1dd496305c 100644 --- a/include/boost/geometry/srs/projections/str_cast.hpp +++ b/include/boost/geometry/srs/projections/str_cast.hpp @@ -11,10 +11,11 @@ #ifndef BOOST_GEOMETRY_SRS_PROJECTIONS_STR_CAST_HPP #define BOOST_GEOMETRY_SRS_PROJECTIONS_STR_CAST_HPP +#include + #include #include #include -#include namespace boost { namespace geometry { @@ -116,7 +117,7 @@ struct str_cast_traits_generic char * str_end = (char*)(void*)str; T res = str_cast_traits_strtox < - typename boost::remove_cv::type + typename std::remove_cv::type >::apply(str, &str_end); if (str_end == str) { diff --git a/include/boost/geometry/srs/sphere.hpp b/include/boost/geometry/srs/sphere.hpp index 9be5abf7ac..78d6bf33fd 100644 --- a/include/boost/geometry/srs/sphere.hpp +++ b/include/boost/geometry/srs/sphere.hpp @@ -22,8 +22,6 @@ #include -#include - #include #include #include @@ -55,7 +53,7 @@ class sphere template RadiusType get_radius() const { - BOOST_STATIC_ASSERT(I < 3); + static_assert(I < 3, "Index must be < 3"); return m_r; } @@ -63,7 +61,7 @@ class sphere template void set_radius(RadiusType const& radius) { - BOOST_STATIC_ASSERT(I < 3); + static_assert(I < 3, "Index must be < 3"); m_r = radius; } diff --git a/include/boost/geometry/srs/spheroid.hpp b/include/boost/geometry/srs/spheroid.hpp index f8e5b51816..7006a18283 100644 --- a/include/boost/geometry/srs/spheroid.hpp +++ b/include/boost/geometry/srs/spheroid.hpp @@ -22,8 +22,6 @@ #include -#include - #include #include #include @@ -86,7 +84,7 @@ class spheroid BOOST_GEOMETRY_ASSERT(m_created == 1); #endif - BOOST_STATIC_ASSERT(I < 3); + static_assert(I < 3, "Index must be < 3"); return I < 2 ? m_a : m_b; } @@ -98,7 +96,7 @@ class spheroid BOOST_GEOMETRY_ASSERT(m_created == 1); #endif - BOOST_STATIC_ASSERT(I < 3); + static_assert(I < 3, "Index must be < 3"); (I < 2 ? m_a : m_b) = radius; } diff --git a/include/boost/geometry/strategies/agnostic/buffer_distance_asymmetric.hpp b/include/boost/geometry/strategies/agnostic/buffer_distance_asymmetric.hpp index 85404ee174..52c35bf067 100644 --- a/include/boost/geometry/strategies/agnostic/buffer_distance_asymmetric.hpp +++ b/include/boost/geometry/strategies/agnostic/buffer_distance_asymmetric.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_GEOMETRY_STRATEGIES_AGNOSTIC_BUFFER_DISTANCE_ASYMMETRIC_HPP #define BOOST_GEOMETRY_STRATEGIES_AGNOSTIC_BUFFER_DISTANCE_ASYMMETRIC_HPP -#include +#include #include #include @@ -86,7 +86,8 @@ public : inline NumericType max_distance(JoinStrategy const& join_strategy, EndStrategy const& end_strategy) const { - boost::ignore_unused(join_strategy, end_strategy); + std::ignore = join_strategy; + std::ignore = end_strategy; NumericType const left = geometry::math::abs(m_left); NumericType const right = geometry::math::abs(m_right); diff --git a/include/boost/geometry/strategies/agnostic/buffer_distance_symmetric.hpp b/include/boost/geometry/strategies/agnostic/buffer_distance_symmetric.hpp index aaf765accb..8b0a52aa44 100644 --- a/include/boost/geometry/strategies/agnostic/buffer_distance_symmetric.hpp +++ b/include/boost/geometry/strategies/agnostic/buffer_distance_symmetric.hpp @@ -10,7 +10,7 @@ #define BOOST_GEOMETRY_STRATEGIES_AGNOSTIC_BUFFER_DISTANCE_SYMMETRIC_HPP -#include +#include #include #include @@ -82,9 +82,10 @@ public : //! Returns the max distance distance up to the buffer will reach template inline NumericType max_distance(JoinStrategy const& join_strategy, - EndStrategy const& end_strategy) const + EndStrategy const& end_strategy) const { - boost::ignore_unused(join_strategy, end_strategy); + std::ignore = join_strategy; + std::ignore = end_strategy; NumericType const dist = geometry::math::abs(m_distance); return (std::max)(join_strategy.max_distance(dist), diff --git a/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp b/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp index 0cfb0425cb..28d635afd9 100644 --- a/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp +++ b/include/boost/geometry/strategies/agnostic/point_in_box_by_side.hpp @@ -20,8 +20,7 @@ #define BOOST_GEOMETRY_STRATEGIES_AGNOSTIC_POINT_IN_BOX_BY_SIDE_HPP #include - -#include +#include #include #include @@ -80,7 +79,7 @@ template inline bool point_in_box_by_side(Point const& point, Box const& box, Strategy const& strategy) { - boost::ignore_unused(strategy); + std::ignore = strategy; // Create (counterclockwise) array of points, the fifth one closes it // Every point should be on the LEFT side (=1), or ON the border (=0), diff --git a/include/boost/geometry/strategies/cartesian/buffer_end_round.hpp b/include/boost/geometry/strategies/cartesian/buffer_end_round.hpp index 49f8761054..9e3370ce86 100644 --- a/include/boost/geometry/strategies/cartesian/buffer_end_round.hpp +++ b/include/boost/geometry/strategies/cartesian/buffer_end_round.hpp @@ -14,8 +14,6 @@ #ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_BUFFER_END_ROUND_HPP #define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_BUFFER_END_ROUND_HPP -#include - #include #include #include @@ -110,15 +108,13 @@ public : //! Fills output_range with a round end template inline void apply(Point const& penultimate_point, - Point const& perp_left_point, + Point const&, Point const& ultimate_point, Point const& perp_right_point, buffer_side_selector side, DistanceStrategy const& distance, RangeOut& range_out) const { - boost::ignore_unused(perp_left_point); - using promoted_type = typename geometry::select_most_precise < coordinate_type_t, diff --git a/include/boost/geometry/strategies/cartesian/buffer_join_round.hpp b/include/boost/geometry/strategies/cartesian/buffer_join_round.hpp index e5e9c31e13..3ecebe1e04 100644 --- a/include/boost/geometry/strategies/cartesian/buffer_join_round.hpp +++ b/include/boost/geometry/strategies/cartesian/buffer_join_round.hpp @@ -26,6 +26,8 @@ #ifdef BOOST_GEOMETRY_DEBUG_BUFFER_WARN #include #include +#else +#include #endif @@ -138,9 +140,10 @@ public : geometry::equal_to equals; if (equals(perp1, perp2)) { - boost::ignore_unused(ip); #ifdef BOOST_GEOMETRY_DEBUG_BUFFER_WARN std::cout << "Corner for equal points " << geometry::wkt(ip) << " " << geometry::wkt(perp1) << std::endl; +#else + std::ignore = ip; #endif return false; } diff --git a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp index e3396494aa..5e6d05495a 100644 --- a/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp +++ b/include/boost/geometry/strategies/cartesian/distance_projected_point.hpp @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/include/boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp b/include/boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp deleted file mode 100644 index 3344500bcd..0000000000 --- a/include/boost/geometry/strategies/cartesian/distance_projected_point_ax.hpp +++ /dev/null @@ -1,316 +0,0 @@ -// Boost.Geometry (aka GGL, Generic Geometry Library) - -// Copyright (c) 2008-2014 Bruno Lalande, Paris, France. -// Copyright (c) 2008-2014 Barend Gehrels, Amsterdam, the Netherlands. -// Copyright (c) 2009-2014 Mateusz Loskot, London, UK. - -// This file was modified by Oracle on 2014. -// Modifications copyright (c) 2014, Oracle and/or its affiliates. - -// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle -// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle - -// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library -// (geolib/GGL), copyright (c) 1995-2010 Geodan, 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) - -#ifndef BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISTANCE_PROJECTED_POINT_AX_HPP -#define BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISTANCE_PROJECTED_POINT_AX_HPP - -#include -BOOST_PRAGMA_MESSAGE("This include file is deprecated and will be removed in Boost 1.88") - -#include - -#include -#include - -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -// Helper geometry (projected point on line) -#include - - -namespace boost { namespace geometry -{ - - -namespace strategy { namespace distance -{ - - -#ifndef DOXYGEN_NO_DETAIL -namespace detail -{ - -template -struct projected_point_ax_result -{ - typedef T value_type; - - projected_point_ax_result(T const& c = T(0)) - : atd(c), xtd(c) - {} - - projected_point_ax_result(T const& a, T const& x) - : atd(a), xtd(x) - {} - - friend inline bool operator<(projected_point_ax_result const& left, - projected_point_ax_result const& right) - { - return left.xtd < right.xtd || left.atd < right.atd; - } - - T atd, xtd; -}; - -// This less-comparator may be used as a parameter of detail::douglas_peucker. -// In this simplify strategy distances are compared in 2 places -// 1. to choose the furthest candidate (md < dist) -// 2. to check if the candidate is further than max_distance (max_distance < md) -template -class projected_point_ax_less -{ -public: - projected_point_ax_less(Distance const& max_distance) - : m_max_distance(max_distance) - {} - - inline bool operator()(Distance const& left, Distance const& right) const - { - //return left.xtd < right.xtd && right.atd < m_max_distance.atd; - - typedef typename Distance::value_type value_type; - - value_type const lx = left.xtd > m_max_distance.xtd ? left.xtd - m_max_distance.xtd : 0; - value_type const rx = right.xtd > m_max_distance.xtd ? right.xtd - m_max_distance.xtd : 0; - value_type const la = left.atd > m_max_distance.atd ? left.atd - m_max_distance.atd : 0; - value_type const ra = right.atd > m_max_distance.atd ? right.atd - m_max_distance.atd : 0; - - value_type const l = (std::max)(lx, la); - value_type const r = (std::max)(rx, ra); - - return l < r; - } -private: - Distance const& m_max_distance; -}; - -// This strategy returns 2-component Point/Segment distance. -// The ATD (along track distance) is parallel to the Segment -// and is a distance between Point projected into a line defined by a Segment and the nearest Segment's endpoint. -// If the projected Point intersects the Segment the ATD is equal to 0. -// The XTD (cross track distance) is perpendicular to the Segment -// and is a distance between input Point and its projection. -// If the Segment has length equal to 0, ATD and XTD has value equal -// to the distance between the input Point and one of the Segment's endpoints. -// -// p3 p4 -// ^ 7 -// | / -// p1<-----e========e----->p2 -// -// p1: atd=D, xtd=0 -// p2: atd=D, xtd=0 -// p3: atd=0, xtd=D -// p4: atd=D/2, xtd=D -template -< - typename CalculationType = void, - typename Strategy = pythagoras -> -class projected_point_ax -{ -public : - template - struct calculation_type - : public projected_point - ::template calculation_type - {}; - - template - struct result_type - { - typedef projected_point_ax_result - < - typename calculation_type::type - > type; - }; - -public : - - template - inline typename result_type::type - apply(Point const& p, PointOfSegment const& p1, PointOfSegment const& p2) const - { - assert_dimension_equal(); - - typedef typename calculation_type::type calculation_type; - - // A projected point of points in Integer coordinates must be able to be - // represented in FP. - typedef model::point - < - calculation_type, - dimension::value, - coordinate_system_t - > fp_point_type; - - // For convenience - typedef fp_point_type fp_vector_type; - - /* - Algorithm [p: (px,py), p1: (x1,y1), p2: (x2,y2)] - VECTOR v(x2 - x1, y2 - y1) - VECTOR w(px - x1, py - y1) - c1 = w . v - c2 = v . v - b = c1 / c2 - RETURN POINT(x1 + b * vx, y1 + b * vy) - */ - - // v is multiplied below with a (possibly) FP-value, so should be in FP - // For consistency we define w also in FP - fp_vector_type v, w, projected; - - geometry::convert(p2, v); - geometry::convert(p, w); - geometry::convert(p1, projected); - subtract_point(v, projected); - subtract_point(w, projected); - - Strategy strategy; - boost::ignore_unused(strategy); - - typename result_type::type result; - - calculation_type const zero = calculation_type(); - calculation_type const c2 = dot_product(v, v); - if ( math::equals(c2, zero) ) - { - result.xtd = strategy.apply(p, projected); - // assume that the 0-length segment is perpendicular to the Pt->ProjPt vector - result.atd = 0; - return result; - } - - calculation_type const c1 = dot_product(w, v); - calculation_type const b = c1 / c2; - multiply_value(v, b); - add_point(projected, v); - - result.xtd = strategy.apply(p, projected); - - if (c1 <= zero) - { - result.atd = strategy.apply(p1, projected); - } - else if (c2 <= c1) - { - result.atd = strategy.apply(p2, projected); - } - else - { - result.atd = 0; - } - - return result; - } -}; - -} // namespace detail -#endif // DOXYGEN_NO_DETAIL - -#ifndef DOXYGEN_NO_STRATEGY_SPECIALIZATIONS -namespace services -{ - - -template -struct tag > -{ - typedef strategy_tag_distance_point_segment type; -}; - - -template -struct return_type, P, PS> -{ - typedef typename detail::projected_point_ax - ::template result_type::type type; -}; - - -template -struct comparable_type > -{ - // Define a projected_point strategy with its underlying point-point-strategy - // being comparable - typedef detail::projected_point_ax - < - CalculationType, - typename comparable_type::type - > type; -}; - - -template -struct get_comparable > -{ - typedef typename comparable_type - < - detail::projected_point_ax - >::type comparable_type; -public : - static inline comparable_type apply(detail::projected_point_ax const& ) - { - return comparable_type(); - } -}; - - -template -struct result_from_distance, P, PS> -{ -private : - typedef typename return_type, P, PS>::type return_type; -public : - template - static inline return_type apply(detail::projected_point_ax const& , T const& value) - { - Strategy s; - return_type ret; - ret.atd = result_from_distance::apply(s, value.atd); - ret.xtd = result_from_distance::apply(s, value.xtd); - return ret; - } -}; - - -} // namespace services -#endif // DOXYGEN_NO_STRATEGY_SPECIALIZATIONS - - -}} // namespace strategy::distance - - -}} // namespace boost::geometry - -#endif // BOOST_GEOMETRY_STRATEGIES_CARTESIAN_DISTANCE_PROJECTED_POINT_AX_HPP diff --git a/include/boost/geometry/strategies/concepts/area_concept.hpp b/include/boost/geometry/strategies/concepts/area_concept.hpp index f31bfa93c3..6b65809fe1 100644 --- a/include/boost/geometry/strategies/concepts/area_concept.hpp +++ b/include/boost/geometry/strategies/concepts/area_concept.hpp @@ -19,9 +19,9 @@ #ifndef BOOST_GEOMETRY_STRATEGIES_CONCEPTS_AREA_CONCEPT_HPP #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_AREA_CONCEPT_HPP +#include #include -#include #include @@ -40,26 +40,25 @@ class AreaStrategy #ifndef DOXYGEN_NO_CONCEPT_MEMBERS // 1) must define state template, - typedef typename Strategy::template state state_type; + using state_type = typename Strategy::template state; // 2) must define result_type template, - typedef typename Strategy::template result_type::type return_type; + using return_type = typename Strategy::template result_type::type; struct check_methods { static void apply() { - Strategy const* str = 0; - state_type *st = 0; + Strategy const* str = nullptr; + state_type *st = nullptr; // 3) must implement a method apply with the following signature - geometry::point_type_t const* sp = 0; + geometry::point_type_t const* sp = nullptr; str->apply(*sp, *sp, *st); - // 4) must implement a static method result with the following signature - return_type r = str->result(*st); - - boost::ignore_unused(r, str); + // 4) must implement a method result with the following signature + static_assert(std::is_convertibleresult(*st))>::value, + "Strategy::result(state_type&) must be convertible to result_type::type"); } }; diff --git a/include/boost/geometry/strategies/concepts/centroid_concept.hpp b/include/boost/geometry/strategies/concepts/centroid_concept.hpp index 9a1dcbcc95..b87ecc57dc 100644 --- a/include/boost/geometry/strategies/concepts/centroid_concept.hpp +++ b/include/boost/geometry/strategies/concepts/centroid_concept.hpp @@ -15,9 +15,9 @@ #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_CENTROID_CONCEPT_HPP +#include #include -#include namespace boost { namespace geometry { namespace concepts { @@ -33,32 +33,26 @@ class CentroidStrategy #ifndef DOXYGEN_NO_CONCEPT_MEMBERS // 1) must define state_type, - typedef typename Strategy::state_type state_type; + using state_type = typename Strategy::state_type; // 2) must define point_type, - typedef typename Strategy::point_type point_type; + using point_type = typename Strategy::point_type; // 3) must define point_type, of polygon (segments) - typedef typename Strategy::segment_point_type spoint_type; + using spoint_type = typename Strategy::segment_point_type; struct check_methods { static void apply() { - Strategy *str = 0; - state_type *st = 0; - // 4) must implement a static method apply, // getting two segment-points - spoint_type const* sp = 0; - str->apply(*sp, *sp, *st); + Strategy::apply(spoint_type{}, spoint_type{}, state_type{}); // 5) must implement a static method result // getting the centroid - point_type *c = 0; - bool r = str->result(*st, *c); - - boost::ignore_unused(str, r); + static_assert(std::is_constructible::value, + "Strategy::apply(state_type, point_type) must return bool."); } }; diff --git a/include/boost/geometry/strategies/concepts/convex_hull_concept.hpp b/include/boost/geometry/strategies/concepts/convex_hull_concept.hpp index d4295ce47b..cb637e22e2 100644 --- a/include/boost/geometry/strategies/concepts/convex_hull_concept.hpp +++ b/include/boost/geometry/strategies/concepts/convex_hull_concept.hpp @@ -51,11 +51,11 @@ class ConvexHullStrategy { static void apply() { - Strategy const* str = 0; + Strategy const* str = nullptr; - state_type* st = 0; - geometry_type* sp = 0; - std::vector *v = 0; + state_type* st = nullptr; + geometry_type* sp = nullptr; + std::vector *v = nullptr; // 4) must implement a method apply, iterating over a range str->apply(*sp, *st); diff --git a/include/boost/geometry/strategies/concepts/distance_concept.hpp b/include/boost/geometry/strategies/concepts/distance_concept.hpp index c14e4e3bc2..3a5a5ca7b4 100644 --- a/include/boost/geometry/strategies/concepts/distance_concept.hpp +++ b/include/boost/geometry/strategies/concepts/distance_concept.hpp @@ -25,7 +25,6 @@ #include #include -#include #include @@ -76,19 +75,19 @@ private : >::type rtype; // 3) must define meta-function "comparable_type" - typedef typename strategy::distance::services::comparable_type + using ctype = typename strategy::distance::services::comparable_type < Strategy - >::type ctype; + >::type; // 4) must define meta-function "tag" - typedef typename strategy::distance::services::tag + using tag = typename strategy::distance::services::tag < Strategy - >::type tag; + >::type; - static const bool is_correct_strategy_tag = - std::is_same::value + constexpr bool is_correct_strategy_tag = + std::is_same::value || std::is_same::value || std::is_same::value; @@ -98,26 +97,31 @@ private : Strategy, tag); // 5) must implement apply with arguments - Strategy* str = 0; - ptype1 *p1 = 0; - ptype2 *p2 = 0; - rtype r = str->apply(*p1, *p2); + Strategy* str = nullptr; + ptype1 *p1 = nullptr; + ptype2 *p2 = nullptr; + static_assert(std::is_convertibleapply(*p1, *p2))>::value, + "rtype must be initialisable from strategy.apply(ptype1&, ptype2&)"); // 6) must define (meta)struct "get_comparable" with apply - ctype c = strategy::distance::services::get_comparable - < - Strategy - >::apply(*str); + static_assert(std::is_convertible + < + ctype, + decltype(strategy::distance::services::get_comparable::apply(*str)) + >::value, + "comparable_distance::type must be initialisable from get_comparable::apply(Strategy&)"); // 7) must define (meta)struct "result_from_distance" with apply - r = strategy::distance::services::result_from_distance - < - Strategy, - ptype1, ptype2 - >::apply(*str, 1.0); - - boost::ignore_unused(); - boost::ignore_unused(str, c, r); + static_assert(std::is_convertible + < + rtype, + decltype( + strategy::distance::services::result_from_distance + < + Strategy, ptype1, ptype2 + >::apply(*str, 1.0)) + >::value, + "rtype must be initialisable from result_from_distance.apply(Strategy&, double)"); } }; @@ -171,32 +175,33 @@ private : Strategy, tag); // 3) must define meta-function "return_type" - typedef typename services::return_type + using rtype = typename services::return_type < Strategy, ptype, sptype - >::type rtype; + >::type; // 4) must define meta-function "comparable_type" - typedef typename services::comparable_type::type ctype; + using ctype = typename services::comparable_type::type; // 5) must implement apply with arguments - Strategy *str = 0; - ptype *p = 0; - sptype *sp1 = 0; - sptype *sp2 = 0; + Strategy *str = nullptr; + ptype *p = nullptr; + sptype *sp = nullptr; - rtype r = str->apply(*p, *sp1, *sp2); + static_assert(std::is_convertibleapply(*p, *sp, *sp))>::value, + "return_type::type must be initialisable from strategy.apply(arg1_t&, arg2_t&, arg2_t&)"); // 6) must define (meta-)struct "get_comparable" with apply - ctype cstrategy = services::get_comparable::apply(*str); + static_assert(std::is_convertible::apply(*str))>::value, + "comparable_type::type must be initialisable from get_comparable::apply(Strategy&)"); // 7) must define (meta-)struct "result_from_distance" with apply - r = services::result_from_distance - < - Strategy, ptype, sptype - >::apply(*str, rtype(1.0)); - - boost::ignore_unused(str, r, cstrategy); + static_assert(std::is_convertible + < + rtype, + decltype(services::result_from_distance::apply(*str, rtype(1.0))) + >::value, + "return_type::type must be initialisable from result_from_distance::apply(Strategy&, rtype&)"); } }; diff --git a/include/boost/geometry/strategies/concepts/simplify_concept.hpp b/include/boost/geometry/strategies/concepts/simplify_concept.hpp index 01f7a7510c..f306cdc2e6 100644 --- a/include/boost/geometry/strategies/concepts/simplify_concept.hpp +++ b/include/boost/geometry/strategies/concepts/simplify_concept.hpp @@ -19,11 +19,11 @@ #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_SIMPLIFY_CONCEPT_HPP #include +#include #include #include #include -#include #include #include @@ -54,26 +54,30 @@ private : static void apply(ApplyMethod) { namespace ft = boost::function_types; - typedef typename ft::parameter_types + using parameter_types = typename ft::parameter_types < ApplyMethod - >::type parameter_types; + >::type; - typedef std::conditional_t + using base_index = std::conditional_t < ft::is_member_function_pointer::value, std::integral_constant, std::integral_constant - > base_index; + >; + static_assert(sizeof(parameter_types) > 0, + "boost::function_types::parameter_types must be instantiable."); + static_assert(sizeof(base_index) > 0, + "boost::function_types::is_member_function::value must be instantiable."); BOOST_CONCEPT_ASSERT ( (concepts::PointSegmentDistanceStrategy) ); - Strategy *str = 0; - std::vector const* v1 = 0; - std::vector * v2 = 0; + Strategy *str = nullptr; + std::vector const* v1 = nullptr; + std::vector * v2 = nullptr; // 2) must implement method apply with arguments // - Range @@ -81,8 +85,7 @@ private : // - floating point value str->apply(*v1, std::back_inserter(*v2), 1.0); - boost::ignore_unused(); - boost::ignore_unused(str); + std::ignore = str; } }; diff --git a/include/boost/geometry/strategies/concepts/within_concept.hpp b/include/boost/geometry/strategies/concepts/within_concept.hpp index 7e37f45af4..2e2ad8bb8a 100644 --- a/include/boost/geometry/strategies/concepts/within_concept.hpp +++ b/include/boost/geometry/strategies/concepts/within_concept.hpp @@ -19,10 +19,10 @@ #define BOOST_GEOMETRY_STRATEGIES_CONCEPTS_WITHIN_CONCEPT_HPP +#include #include #include -#include #include #include @@ -151,15 +151,16 @@ class WithinStrategyPolygonal // CHECK: calling method apply and result - strategy_type const* str = 0; - state_type* st = 0; - point_type const* p = 0; - segment_point_type const* sp = 0; - - bool b = str->apply(*p, *sp, *sp, *st); - int r = str->result(*st); - - boost::ignore_unused(r, b, str); + strategy_type const* str = nullptr; + state_type* st = nullptr; + point_type const* p = nullptr; + segment_point_type const* sp = nullptr; + + static_assert(std::is_convertibleapply(*p, *sp, *sp, *st))>::value, + "strategy.apply(const point_type&, const segment_point_type&, const segment_point_type&, state_type&) must be convertible to bool"); + static_assert(std::is_convertibleresult(*st))>::value, + "strategy.result(state_type&) must be convertible to int"); + std::ignore = str; } }; @@ -223,13 +224,12 @@ class WithinStrategyPointBox // CHECK: calling method apply - strategy_type const* str = 0; - point_type const* p = 0; - box_type const* bx = 0; - - bool b = str->apply(*p, *bx); - - boost::ignore_unused(b, str); + strategy_type const* str = nullptr; + point_type const* p = nullptr; + box_type const* bx = nullptr; + static_assert(std::is_convertibleapply(*p, *bx))>::value, + "strategy.apply(const point_type&, const box_type&) must be convertible to bool"); + std::ignore = str; } }; @@ -292,13 +292,13 @@ class WithinStrategyBoxBox // CHECK: calling method apply - strategy_type const* str = 0; - box_type1 const* b1 = 0; - box_type2 const* b2 = 0; - - bool b = str->apply(*b1, *b2); + strategy_type const* str = nullptr; + box_type1 const* b1 = nullptr; + box_type2 const* b2 = nullptr; - boost::ignore_unused(b, str); + static_assert(std::is_convertibleapply(*b1, *b2))>::value, + "strategy.apply(const box_type1&, const box_type2&) must be convertible to bool"); + std::ignore = str; } }; @@ -374,7 +374,7 @@ inline void check() tag_cast_t, areal_tag>, Strategy > c; - boost::ignore_unused(c); + std::ignore = c; } diff --git a/include/boost/geometry/strategies/geographic/mapping_ssf.hpp b/include/boost/geometry/strategies/geographic/mapping_ssf.hpp index 57fd985a9c..c578a76cd0 100644 --- a/include/boost/geometry/strategies/geographic/mapping_ssf.hpp +++ b/include/boost/geometry/strategies/geographic/mapping_ssf.hpp @@ -15,8 +15,6 @@ #define BOOST_GEOMETRY_STRATEGIES_GEOGRAPHIC_MAPPING_SSF_HPP -#include - #include #include diff --git a/include/boost/geometry/strategy/spherical/envelope_segment.hpp b/include/boost/geometry/strategy/spherical/envelope_segment.hpp index f211e0bab3..04e0fcf4f0 100644 --- a/include/boost/geometry/strategy/spherical/envelope_segment.hpp +++ b/include/boost/geometry/strategy/spherical/envelope_segment.hpp @@ -13,10 +13,9 @@ #include +#include #include -#include - #include #include @@ -158,7 +157,8 @@ class envelope_segment_impl { // coordinates are assumed to be in radians BOOST_GEOMETRY_ASSERT(lon1 <= lon2); - boost::ignore_unused(lon1, lon2); + std::ignore = lon1; + std::ignore = lon2; CalculationType lat1_rad = math::as_radian(lat1); CalculationType lat2_rad = math::as_radian(lat2); diff --git a/include/boost/geometry/util/calculation_type.hpp b/include/boost/geometry/util/calculation_type.hpp index bc140b4cd9..45d6d8fefe 100644 --- a/include/boost/geometry/util/calculation_type.hpp +++ b/include/boost/geometry/util/calculation_type.hpp @@ -17,8 +17,6 @@ #define BOOST_GEOMETRY_UTIL_CALCULATION_TYPE_HPP -#include - #include #include @@ -34,7 +32,7 @@ namespace detail struct default_integral { - typedef long long type; + using type = long long; }; /*! @@ -53,18 +51,20 @@ template > struct calculation_type { - BOOST_STATIC_ASSERT(( + static_assert( std::is_fundamental < DefaultFloatingPointCalculationType - >::value - )); - BOOST_STATIC_ASSERT(( + >::value, + "DefaultFloatingPointCalculationType must be a fundamental type" + ); + static_assert( std::is_fundamental < DefaultIntegralCalculationType - >::value - )); + >::value, + "DefaultIntegralCalculationType must be a fundamental type" + ); typedef std::conditional_t diff --git a/include/boost/geometry/util/math.hpp b/include/boost/geometry/util/math.hpp index ed011da726..2007bea28b 100644 --- a/include/boost/geometry/util/math.hpp +++ b/include/boost/geometry/util/math.hpp @@ -25,8 +25,7 @@ #include #include #include - -#include +#include #include #include @@ -180,7 +179,7 @@ struct equals template static inline bool apply(Type const& a, Type const& b, Policy const& policy) { - boost::ignore_unused(policy); + std::ignore = policy; if (a == b) { diff --git a/include/boost/geometry/util/series_expansion.hpp b/include/boost/geometry/util/series_expansion.hpp index 55c8b8f2fc..ff5b7d47a9 100644 --- a/include/boost/geometry/util/series_expansion.hpp +++ b/include/boost/geometry/util/series_expansion.hpp @@ -30,7 +30,8 @@ #ifndef BOOST_GEOMETRY_UTIL_SERIES_EXPANSION_HPP #define BOOST_GEOMETRY_UTIL_SERIES_EXPANSION_HPP -#include +#include + #include #include @@ -156,7 +157,7 @@ namespace boost { namespace geometry { namespace series_expansion { template inline void evaluate_coeffs_A3(Coeffs &c, CT const& n) { - switch (int(Coeffs::static_size)) + switch (int(c.size())) { case 0: break; @@ -228,7 +229,7 @@ namespace boost { namespace geometry { namespace series_expansion { { CT const eps2 = math::sqr(eps); CT d = eps; - switch (int(Coeffs::static_size) - 1) + switch (int(c.size()) - 1) { case 0: break; @@ -328,7 +329,7 @@ namespace boost { namespace geometry { namespace series_expansion { { CT const eps2 = math::sqr(eps); CT d = eps; - switch (int(Coeffs::static_size) - 1) + switch (int(c.size()) - 1) { case 0: break; @@ -428,7 +429,7 @@ namespace boost { namespace geometry { namespace series_expansion { { CT const eps2 = math::sqr(eps); CT d = eps; - switch (int(Coeffs::static_size) - 1) + switch (int(c.size()) - 1) { case 0: break; @@ -525,7 +526,7 @@ namespace boost { namespace geometry { namespace series_expansion { */ template inline void evaluate_coeffs_C3x(Coeffs &c, CT const& n) { - BOOST_GEOMETRY_ASSERT((Coeffs::static_size == (SeriesOrder * (SeriesOrder - 1)) / 2)); + BOOST_GEOMETRY_ASSERT((c.size() == (SeriesOrder * (SeriesOrder - 1)) / 2)); CT const n2 = math::sqr(n); switch (SeriesOrder) @@ -648,10 +649,10 @@ namespace boost { namespace geometry { namespace series_expansion { size_t offset = 0; // i is the index of C3[i]. - for (size_t i = 1; i < Coeffs1::static_size; ++i) + for (size_t i = 1; i < coeffs1.size(); ++i) { // Order of polynomial in eps. - size_t m = Coeffs1::static_size - i; + size_t m = coeffs1.size() - i; mult *= eps; coeffs1[i] = mult * math::horner_evaluate(eps, coeffs2.begin() + offset, @@ -672,7 +673,7 @@ namespace boost { namespace geometry { namespace series_expansion { template inline CT sin_cos_series(CT const& sinx, CT const& cosx, Coeffs const& coeffs) { - size_t n = Coeffs::static_size - 1; + size_t n = coeffs.size() - 1; size_t index = 0; // Point to one beyond last element. @@ -699,7 +700,7 @@ namespace boost { namespace geometry { namespace series_expansion { These structs allow the caller to only know the series order. */ template - struct coeffs_C1 : boost::array + struct coeffs_C1 : std::array { coeffs_C1(CT const& epsilon) { @@ -708,7 +709,7 @@ namespace boost { namespace geometry { namespace series_expansion { }; template - struct coeffs_C1p : boost::array + struct coeffs_C1p : std::array { coeffs_C1p(CT const& epsilon) { @@ -717,7 +718,7 @@ namespace boost { namespace geometry { namespace series_expansion { }; template - struct coeffs_C2 : boost::array + struct coeffs_C2 : std::array { coeffs_C2(CT const& epsilon) { @@ -726,7 +727,7 @@ namespace boost { namespace geometry { namespace series_expansion { }; template - struct coeffs_C3x : boost::array + struct coeffs_C3x : std::array { coeffs_C3x(CT const& n) { @@ -735,7 +736,7 @@ namespace boost { namespace geometry { namespace series_expansion { }; template - struct coeffs_C3 : boost::array + struct coeffs_C3 : std::array { coeffs_C3(CT const& n, CT const& epsilon) { @@ -746,7 +747,7 @@ namespace boost { namespace geometry { namespace series_expansion { }; template - struct coeffs_A3 : boost::array + struct coeffs_A3 : std::array { coeffs_A3(CT const& n) { diff --git a/include/boost/geometry/views/reversible_view.hpp b/include/boost/geometry/views/reversible_view.hpp index 5aad54382c..cb5677cfda 100644 --- a/include/boost/geometry/views/reversible_view.hpp +++ b/include/boost/geometry/views/reversible_view.hpp @@ -20,7 +20,6 @@ #define BOOST_GEOMETRY_VIEWS_REVERSIBLE_VIEW_HPP -#include #include #include diff --git a/test/algorithms/overlay/copy_segment_point.cpp b/test/algorithms/overlay/copy_segment_point.cpp index 5a85c2080b..7764fc35c9 100644 --- a/test/algorithms/overlay/copy_segment_point.cpp +++ b/test/algorithms/overlay/copy_segment_point.cpp @@ -7,6 +7,8 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +#include + #include #include @@ -99,7 +101,7 @@ void test_box(std::string const& case_id, std::string const& wkt) test_geometry(case_id, wkt, [](box_type const& box) { - boost::array ring; + std::array ring; bg::detail::assign_box_corners_oriented(box, ring); return ring; }); diff --git a/test/geometries/custom_non_copiable/helper_functions.hpp b/test/geometries/custom_non_copiable/helper_functions.hpp index 563baf2b52..4739aac168 100644 --- a/test/geometries/custom_non_copiable/helper_functions.hpp +++ b/test/geometries/custom_non_copiable/helper_functions.hpp @@ -16,6 +16,10 @@ #include #include +#if ! defined(TEST_WITH_SVG_FILE) +#include +#endif + template void fill(Ring& ring, std::vector::type> const& v) { @@ -128,13 +132,15 @@ void create_svg(std::ostream& stream, Geometry1 const& a, Geometry2 const& b, Ge void write_svg(std::ostringstream& svg, std::string const& filename) { - boost::ignore_unused(svg, filename); #if defined(TEST_WITH_SVG_FILE) std::ofstream tmp("/tmp/" + filename); if (tmp.good()) { tmp << svg.str(); } +#else + std::ignore = svg; + std::ignore = filename; #endif }