diff --git a/build.jam b/build.jam index 72da25de40..f9794efb4c 100644 --- a/build.jam +++ b/build.jam @@ -39,7 +39,6 @@ constant boost_dependencies : /boost/throw_exception//boost_throw_exception /boost/tokenizer//boost_tokenizer /boost/tuple//boost_tuple - /boost/type_traits//boost_type_traits /boost/variant//boost_variant /boost/variant2//boost_variant2 ; diff --git a/doc/design_rationale.qbk b/doc/design_rationale.qbk index 0a76ead0c9..d6ddcfe388 100644 --- a/doc/design_rationale.qbk +++ b/doc/design_rationale.qbk @@ -151,7 +151,8 @@ The distance function is calling that `pythagoras` structure, specifying the num template double distance(P1 const& a, P2 const& b) { - BOOST_STATIC_ASSERT(( dimension::value == dimension::value )); + static_assert(dimension::value == dimension::value, + "Distance can only be computed for points of same dimension."); return sqrt(pythagoras::value>::apply(a, b)); } diff --git a/doc/doxy/Doxyfile b/doc/doxy/Doxyfile index fe49c1ea84..1fad143dad 100644 --- a/doc/doxy/Doxyfile +++ b/doc/doxy/Doxyfile @@ -328,7 +328,6 @@ INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = BOOST_CONCEPT_REQUIRES(x) \ BOOST_CONCEPT_ASSERT(x) \ - BOOST_STATIC_ASSERT(x) \ DOXYGEN_SHOULD_SKIP_THIS \ DOXYGEN_NO_DISPATCH \ DOXYGEN_NO_IMPL \ diff --git a/doc/src/docutils/tools/support_status/support_status.cpp b/doc/src/docutils/tools/support_status/support_status.cpp index 2105e6ac24..0175e82d9f 100644 --- a/doc/src/docutils/tools/support_status/support_status.cpp +++ b/doc/src/docutils/tools/support_status/support_status.cpp @@ -14,10 +14,10 @@ #include #include #include +#include #include #include -#include #define BOOST_GEOMETRY_IMPLEMENTATION_STATUS_BUILD true @@ -112,7 +112,7 @@ struct do_unary_test void operator()() { - if (boost::is_base_of >::type::value) + if (std::is_base_of >::type::value) { m_outputter.nyi(); } @@ -134,7 +134,7 @@ struct do_binary_test template void operator()(G1) { - if (boost::is_base_of >::type::value) + if (std::is_base_of >::type::value) { m_outputter.nyi(); } diff --git a/doc/src/examples/core/ring_type.cpp b/doc/src/examples/core/ring_type.cpp index ba391c35a5..6a728cbeac 100644 --- a/doc/src/examples/core/ring_type.cpp +++ b/doc/src/examples/core/ring_type.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -36,7 +37,7 @@ int main() std::cout << std::boolalpha - << boost::is_same::value + << std::is_same::value << std::endl; return 0; diff --git a/doc/src/examples/core/rings.cpp b/doc/src/examples/core/rings.cpp index 4ce004ce0b..0ae37cac16 100644 --- a/doc/src/examples/core/rings.cpp +++ b/doc/src/examples/core/rings.cpp @@ -15,6 +15,7 @@ Also shows the related ring_type and interior_type. */ #include +#include #include #include @@ -59,7 +60,7 @@ int main() std::cout << std::boolalpha - << boost::is_same::value + << std::is_same::value << std::endl; return 0; diff --git a/example/c04_a_custom_triangle_example.cpp b/example/c04_a_custom_triangle_example.cpp index 4ef5e61189..033806796f 100644 --- a/example/c04_a_custom_triangle_example.cpp +++ b/example/c04_a_custom_triangle_example.cpp @@ -10,10 +10,9 @@ // // Custom Triangle Example +#include #include -#include - #include #include #include @@ -22,7 +21,7 @@ #include -struct triangle : public boost::array, 4> +struct triangle : public std::array, 4> { inline void close() { diff --git a/example/c04_b_custom_triangle_example.cpp b/example/c04_b_custom_triangle_example.cpp index 320dc6eded..102727d2da 100644 --- a/example/c04_b_custom_triangle_example.cpp +++ b/example/c04_b_custom_triangle_example.cpp @@ -10,9 +10,9 @@ // // Custom triangle template Example +#include #include -#include #include #include @@ -26,7 +26,7 @@ BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) template -struct triangle : public boost::array +struct triangle : public std::array { }; diff --git a/example/c06_custom_polygon_example.cpp b/example/c06_custom_polygon_example.cpp index a69a31c672..6efac24ea4 100644 --- a/example/c06_custom_polygon_example.cpp +++ b/example/c06_custom_polygon_example.cpp @@ -9,6 +9,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // // Custom Polygon Example +#include #include #include @@ -38,7 +39,7 @@ struct my_polygon // required for a polygon: an outer ring... my_ring boundary; // ... and a Boost.Range compatible inner ring collection - boost::array holes; + std::array holes; // just for the sample std::string name; @@ -54,7 +55,7 @@ BOOST_GEOMETRY_REGISTER_RING(my_ring) // There is currently no registration macro for polygons -// and besides that a boost::array in a macro would +// and besides that a std::array in a macro would // be very specific, so we show it "by hand": namespace boost { namespace geometry { namespace traits { @@ -65,12 +66,12 @@ template<> struct ring_mutable_type { typedef my_ring& type; }; template<> struct interior_const_type { - typedef boost::array const& type; + typedef std::array const& type; }; template<> struct interior_mutable_type { - typedef boost::array& type; + typedef std::array& type; }; template<> struct exterior_ring @@ -88,7 +89,7 @@ template<> struct exterior_ring template<> struct interior_rings { - typedef boost::array holes_type; + typedef std::array holes_type; static holes_type& get(my_polygon& p) { diff --git a/example/c08_custom_non_std_example.cpp b/example/c08_custom_non_std_example.cpp index 12bb768405..ef7880b65e 100644 --- a/example/c08_custom_non_std_example.cpp +++ b/example/c08_custom_non_std_example.cpp @@ -11,6 +11,7 @@ // Custom polygon example #include +#include #include @@ -74,7 +75,7 @@ struct custom_iterator : public boost::iterator_facade boost::random_access_traversal_tag, typename boost::mpl::if_ < - boost::is_const, + std::is_const, my_point const, my_point >::type& @@ -101,7 +102,7 @@ struct custom_iterator : public boost::iterator_facade typedef typename boost::mpl::if_ < - boost::is_const, + std::is_const, my_point const, my_point >::type my_point_type; diff --git a/extensions/example/experimental/geometry_of.cpp b/extensions/example/experimental/geometry_of.cpp index 9768442f59..0354a3691e 100644 --- a/extensions/example/experimental/geometry_of.cpp +++ b/extensions/example/experimental/geometry_of.cpp @@ -10,12 +10,11 @@ #include #include #include - +#include #include #include -#include #include @@ -40,7 +39,7 @@ struct append_point : proto::callable template struct result - : boost::add_reference + : std::add_lvalue_reference {}; template diff --git a/extensions/test/algorithms/distance_info.cpp b/extensions/test/algorithms/distance_info.cpp index ddbe2ef847..40b73f43e1 100644 --- a/extensions/test/algorithms/distance_info.cpp +++ b/extensions/test/algorithms/distance_info.cpp @@ -11,6 +11,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include +#include #include @@ -61,8 +62,8 @@ void test_distance_info(Geometry1 const& geometry1, Geometry2 const& geometry2, // Check reversed version too. std::string reversed_expected_pp = expected_pp; - if (boost::is_same::type, bg::point_tag>::value - && boost::is_same::type, bg::point_tag>::value + if (std::is_same::type, bg::point_tag>::value + && std::is_same::type, bg::point_tag>::value ) { // For point-point, we cannot check projected-point again, it is also the other one. 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/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp b/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp index 60a42554a2..80ace2a2a8 100644 --- a/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/piece_border.hpp @@ -16,8 +16,8 @@ #include +#include -#include #include #include @@ -202,7 +202,7 @@ struct piece_border BOOST_GEOMETRY_ASSERT(begin < boost::size(ring)); BOOST_GEOMETRY_ASSERT(end <= boost::size(ring)); - m_ring = boost::addressof(ring); + m_ring = std::addressof(ring); m_begin = begin; m_end = end; } diff --git a/include/boost/geometry/algorithms/detail/centroid/translating_transformer.hpp b/include/boost/geometry/algorithms/detail/centroid/translating_transformer.hpp index 593131d055..4247dd0fc7 100644 --- a/include/boost/geometry/algorithms/detail/centroid/translating_transformer.hpp +++ b/include/boost/geometry/algorithms/detail/centroid/translating_transformer.hpp @@ -19,8 +19,8 @@ #include +#include -#include #include #include @@ -82,12 +82,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_points/segment_to_segment.hpp b/include/boost/geometry/algorithms/detail/closest_points/segment_to_segment.hpp index 7e5419e75b..a294248e80 100644 --- a/include/boost/geometry/algorithms/detail/closest_points/segment_to_segment.hpp +++ b/include/boost/geometry/algorithms/detail/closest_points/segment_to_segment.hpp @@ -12,8 +12,7 @@ #include #include - -#include +#include #include #include @@ -97,7 +96,7 @@ class segment_to_segment d[2] = cds.apply(p[0], cp2); d[3] = cds.apply(p[1], cp3); - std::size_t imin = std::distance(boost::addressof(d[0]), std::min_element(d, d + 4)); + std::size_t imin = std::distance(std::addressof(d[0]), std::min_element(d, d + 4)); switch (imin) { diff --git a/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp b/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp index 21933bdd6e..61b58d17ea 100644 --- a/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp +++ b/include/boost/geometry/algorithms/detail/distance/segment_to_segment.hpp @@ -14,8 +14,7 @@ #include #include - -#include +#include #include #include @@ -80,7 +79,7 @@ class segment_to_segment d[2] = cstrategy.apply(p[0], q[0], q[1]); d[3] = cstrategy.apply(p[1], q[0], q[1]); - std::size_t imin = std::distance(boost::addressof(d[0]), + std::size_t imin = std::distance(std::addressof(d[0]), std::min_element(d, d + 4)); if BOOST_GEOMETRY_CONSTEXPR (is_comparable::value) diff --git a/include/boost/geometry/algorithms/detail/for_each_range.hpp b/include/boost/geometry/algorithms/detail/for_each_range.hpp index 5ea414b582..84952ccc67 100644 --- a/include/boost/geometry/algorithms/detail/for_each_range.hpp +++ b/include/boost/geometry/algorithms/detail/for_each_range.hpp @@ -19,11 +19,11 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_FOR_EACH_RANGE_HPP +#include #include #include #include -#include #include #include @@ -52,7 +52,7 @@ struct fe_range_point template static inline bool apply(Point& point, Functor&& f) { - Point* ptr = boost::addressof(point); + Point* ptr = std::addressof(point); return f(std::pair(ptr, ptr + 1)); } }; diff --git a/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp b/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp index 9a51d30eb4..4f6c6f2492 100644 --- a/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp +++ b/include/boost/geometry/algorithms/detail/is_valid/complement_graph.hpp @@ -14,13 +14,12 @@ #include +#include #include #include #include #include -#include - #include #include #include @@ -185,7 +184,7 @@ class complement_graph inline vertex_handle add_vertex(TurnPoint const& turn_point) { std::pair res - = m_vertices.insert(vertex(boost::addressof(turn_point), + = m_vertices.insert(vertex(std::addressof(turn_point), m_num_rings + m_num_turns) ); 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/get_turn_info.hpp b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp index 2c45437103..1b56f60b0b 100644 --- a/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp +++ b/include/boost/geometry/algorithms/detail/overlay/get_turn_info.hpp @@ -441,7 +441,7 @@ 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_assert(Index <= 1, "Index out of bounds."); static unsigned int const index_p = Index; static unsigned int const index_q = 1 - Index; @@ -1206,7 +1206,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 out of bounds."); 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..8e186214c5 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 @@ -197,7 +197,7 @@ class linear_intersections template ip_info const& get() const { - BOOST_STATIC_ASSERT(I < 2); + static_assert(I < 2, "Index I out of bounds."); 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, "EnableFirst or EnableLast must be true."); template #include #include +#include #include #include -#include #include #include @@ -58,7 +58,7 @@ struct indexed_turn_operation : turn_index(ti) , operation_index(oi) , other_seg_id(&oid) - , subject(boost::addressof(sub)) + , subject(std::addressof(sub)) , discarded(dc) {} 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..e839c77438 100644 --- a/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp +++ b/include/boost/geometry/algorithms/detail/relate/areal_areal.hpp @@ -14,6 +14,8 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_AREAL_AREAL_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_AREAL_AREAL_HPP +#include + #include #include @@ -204,9 +206,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, + "Specialisation for areal / areal combination."); static const bool interruption_enabled = true; @@ -519,7 +522,7 @@ struct areal_areal } // store ref to previously analysed (valid) turn - m_previous_turn_ptr = boost::addressof(*it); + m_previous_turn_ptr = std::addressof(*it); // and previously analysed (valid) operation m_previous_operation = op; } diff --git a/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp b/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp index 8ca9049072..94786a9320 100644 --- a/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp +++ b/include/boost/geometry/algorithms/detail/relate/follow_helpers.hpp @@ -15,6 +15,7 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_FOLLOW_HELPERS_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_FOLLOW_HELPERS_HPP +#include #include #include @@ -141,8 +142,8 @@ class point_info public: point_info() : sid_ptr(NULL), pt_ptr(NULL) {} point_info(Point const& pt, segment_identifier const& sid) - : sid_ptr(boost::addressof(sid)) - , pt_ptr(boost::addressof(pt)) + : sid_ptr(std::addressof(sid)) + , pt_ptr(std::addressof(pt)) {} segment_identifier const& seg_id() const { @@ -172,7 +173,7 @@ class same_single { public: same_single(segment_identifier const& sid) - : sid_ptr(boost::addressof(sid)) + : sid_ptr(std::addressof(sid)) {} bool operator()(segment_identifier const& sid) const @@ -194,7 +195,7 @@ class same_ring { public: same_ring(segment_identifier const& sid) - : sid_ptr(boost::addressof(sid)) + : sid_ptr(std::addressof(sid)) {} bool operator()(segment_identifier const& sid) const @@ -220,7 +221,7 @@ class segment_watcher bool update(segment_identifier const& seg_id) { bool result = m_seg_id_ptr == 0 || !SameRange(*m_seg_id_ptr)(seg_id); - m_seg_id_ptr = boost::addressof(seg_id); + m_seg_id_ptr = std::addressof(seg_id); return result; } @@ -276,7 +277,7 @@ class exit_watcher // here we know that we possibly left LS // we must still check if we didn't get back on the same point m_exit_operation = exit_op; - m_exit_turn_ptr = boost::addressof(turn); + m_exit_turn_ptr = std::addressof(turn); } } } diff --git a/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp b/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp index 9be59bd737..d550dc2e61 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_areal.hpp @@ -14,6 +14,8 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_LINEAR_AREAL_HPP #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_LINEAR_AREAL_HPP +#include + #include #include @@ -321,8 +323,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, + "Specialisation for linear/areal combination."); static const bool interruption_enabled = true; @@ -497,7 +500,7 @@ struct linear_areal } } - prev_seg_id_ptr = boost::addressof(it->operations[1].seg_id); + prev_seg_id_ptr = std::addressof(it->operations[1].seg_id); // find the next ring first iterator and check if the analysis should be performed has_boundary_intersection has_boundary_inters; @@ -971,7 +974,7 @@ struct linear_areal // don't update now // we might enter a boundary of some other ring on the same IP m_interior_detected = true; - m_first_interior_other_id_ptr = boost::addressof(other_id); + m_first_interior_other_id_ptr = std::addressof(other_id); } } } @@ -1172,7 +1175,7 @@ struct linear_areal } // store ref to previously analysed (valid) turn - m_previous_turn_ptr = boost::addressof(*it); + m_previous_turn_ptr = std::addressof(*it); // and previously analysed (valid) operation m_previous_operation = op; } @@ -1441,7 +1444,7 @@ struct linear_areal if ( op == overlay::operation_union ) { is_union_detected = true; - m_previous_turn_ptr = boost::addressof(*it); + m_previous_turn_ptr = std::addressof(*it); } return true; diff --git a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp index 8a326265af..960312ea3b 100644 --- a/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp +++ b/include/boost/geometry/algorithms/detail/relate/linear_linear.hpp @@ -15,6 +15,7 @@ #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_RELATE_LINEAR_LINEAR_HPP #include +#include #include #include @@ -566,7 +567,7 @@ struct linear_linear } // store ref to previously analysed (valid) turn - m_previous_turn_ptr = boost::addressof(*it); + m_previous_turn_ptr = std::addressof(*it); // and previously analysed (valid) operation m_previous_operation = op; } @@ -672,7 +673,7 @@ struct linear_linear // operation 'c' should be last for the same IP so we know that the next point won't be the same update(res); - m_degenerated_turn_ptr = boost::addressof(turn); + m_degenerated_turn_ptr = std::addressof(turn); } } else if ( turn.operations[op_id].position == overlay::position_back ) @@ -737,7 +738,7 @@ struct linear_linear } } - m_degenerated_turn_ptr = boost::addressof(turn); + m_degenerated_turn_ptr = std::addressof(turn); } } diff --git a/include/boost/geometry/algorithms/detail/relate/result.hpp b/include/boost/geometry/algorithms/detail/relate/result.hpp index de982c37a8..95fc874f1a 100644 --- a/include/boost/geometry/algorithms/detail/relate/result.hpp +++ b/include/boost/geometry/algorithms/detail/relate/result.hpp @@ -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, "Invalid index pair (out of bounds)."); return m_array[index]; } @@ -92,7 +92,7 @@ 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, "Invalid index pair (out of bounds)."); m_array[index] = V; } @@ -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 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', "D must be 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 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 pair invalid (out of bounds)."); 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 digit."); char const m = mask.template get(); @@ -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, + "Sequence must match matrix 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, "Index F1 out of bounds."); + static_assert(std::size_t(F2) < static_width, "Index F2 out of bounds."); 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 be non-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..52cf5eb3a0 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, "Only 0 and 1 are valid OpIds."); 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..f4ba8f9ed5 100644 --- a/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp +++ b/include/boost/geometry/algorithms/detail/sections/sectionalize.hpp @@ -393,10 +393,10 @@ struct sectionalize_part using box_type = typename section_type::box_type; using point_type = geometry::point_type_t; - BOOST_STATIC_ASSERT + static_assert ( - section_type::dimension_count - == util::sequence_size::value + section_type::dimension_count == util::sequence_size::value, + "Dimension mismatch." ); std::size_t const count = std::distance(begin, end); diff --git a/include/boost/geometry/algorithms/detail/touches/implementation.hpp b/include/boost/geometry/algorithms/detail/touches/implementation.hpp index a29fa8ff45..02ba6066e4 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, + "Touches can only be evaluated for boxes of 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..4eee3ec1f9 100644 --- a/include/boost/geometry/algorithms/detail/turns/compare_turns.hpp +++ b/include/boost/geometry/algorithms/detail/turns/compare_turns.hpp @@ -36,7 +36,7 @@ template > struct less_seg_fraction_other_op { - BOOST_STATIC_ASSERT(OpId < 2); + static_assert(OpId < 2, "Only 0 and 1 are valid OpIds."); static const std::size_t other_op_id = (OpId + 1) % 2; template diff --git a/include/boost/geometry/algorithms/simplify.hpp b/include/boost/geometry/algorithms/simplify.hpp index 5299a3b6dd..52634d486c 100644 --- a/include/boost/geometry/algorithms/simplify.hpp +++ b/include/boost/geometry/algorithms/simplify.hpp @@ -24,10 +24,10 @@ #ifdef BOOST_GEOMETRY_DEBUG_DOUGLAS_PEUCKER #include #endif +#include #include #include -#include #include #include #include @@ -90,7 +90,7 @@ struct douglas_peucker_point bool included; inline douglas_peucker_point(Point const& ap) - : p(boost::addressof(ap)) + : p(std::addressof(ap)) , included(false) {} }; diff --git a/include/boost/geometry/core/coordinate_dimension.hpp b/include/boost/geometry/core/coordinate_dimension.hpp index 7f2e94ac0d..e89f65f5bc 100644 --- a/include/boost/geometry/core/coordinate_dimension.hpp +++ b/include/boost/geometry/core/coordinate_dimension.hpp @@ -108,7 +108,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 check failed."); } /*! @@ -118,13 +118,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 check failed."); } template constexpr inline void assert_dimension_greater_equal() { - BOOST_STATIC_ASSERT(( dimension::value >= Dimensions )); + static_assert(dimension::value >= Dimensions, "Dimension check failed."); } /*! @@ -134,7 +134,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 check failed."); } }} // namespace boost::geometry diff --git a/include/boost/geometry/core/radius.hpp b/include/boost/geometry/core/radius.hpp index 984f61a9e9..db9873a330 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 lower 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 lower 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..f2ad8d9f7a 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, "Specialisation for positive index."); 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, "Specialisation for positive index."); 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, "Specialisation for positive index."); 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, "Specialisation for positive index."); static const std::size_t dimension = geometry::dimension::value; diff --git a/include/boost/geometry/extensions/algebra/geometries/matrix.hpp b/include/boost/geometry/extensions/algebra/geometries/matrix.hpp index 0b90d9ed75..89e9894b84 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, "Row index out of bounds."); + static_assert(J < Cols, "Col index out of bounds."); 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, "Row index out of bounds."); + static_assert(J < Cols, "Col index out of bounds."); 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..814e33fb43 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, "Index K out of bounds."); 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, "Index K out of bounds."); 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..9ff88322a6 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, "Index I out of bounds."); + static_assert(J < Dimension, "Index J out of bounds."); 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, "Index I out of bounds."); + static_assert(J < Dimension, "Index J out of bounds."); 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..b9fc9c46de 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, "Index K out of bounds."); 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, "Index K out of bounds."); 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..226daf2eb7 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, "Index K out of bounds."); 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, "Index K out of bounds."); 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..ed6acb3f34 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, "double must be 8 bytes wide."); + static_assert(sizeof(double) * CHAR_BIT == 64, "double must be 64 bits wide."); 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 bits wide."); 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(); @@ -342,11 +341,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 +354,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 +386,12 @@ 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 +400,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 +436,17 @@ 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; - 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 +470,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) { @@ -512,7 +511,7 @@ 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; @@ -527,11 +526,11 @@ struct read_polygon_policy 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 +557,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) { @@ -718,7 +717,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,7 +727,7 @@ 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; @@ -749,7 +748,7 @@ 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; @@ -785,7 +784,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 +809,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 +834,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 +853,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 +872,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 +891,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 diff --git a/include/boost/geometry/extensions/gis/io/shapelib/dbf_write_attribute.hpp b/include/boost/geometry/extensions/gis/io/shapelib/dbf_write_attribute.hpp index 4ed21de768..c90cd8958c 100644 --- a/include/boost/geometry/extensions/gis/io/shapelib/dbf_write_attribute.hpp +++ b/include/boost/geometry/extensions/gis/io/shapelib/dbf_write_attribute.hpp @@ -63,21 +63,6 @@ template <> struct DBFWriteAttribute } }; -// Derive char* variants from std::string, -// implicitly casting to a temporary std::string -// (note that boost::remove_const does not remove const from "const char*") -template -struct DBFWriteAttribute : DBFWriteAttribute {}; - -template -struct DBFWriteAttribute : DBFWriteAttribute {}; - -template <> -struct DBFWriteAttribute : DBFWriteAttribute {}; - -template <> -struct DBFWriteAttribute : DBFWriteAttribute {}; - } 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..e288d6b8a4 100644 --- a/include/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp +++ b/include/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp @@ -10,10 +10,9 @@ #define BOOST_GEOMETRY_EXT_GIS_IO_SHAPELIB_SHAPE_CREATOR_HPP #include -#include "shapefil.h" +#include -#include -#include +#include "shapefil.h" #include @@ -69,8 +68,15 @@ template typename geometry::tag::type >::value > -class shape_creator : public boost::noncopyable +class shape_creator { + template + using promote_t = typename std::conditional + < + std::is_floating_point::value, + double, + std::conditional::value, int, std::string>::type + >::type; public : shape_creator(std::string const& name) { @@ -90,9 +96,12 @@ 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) - { + {: // Note: we MIGHT design a small wrapper class which destroys in destructor ::SHPObject* obj = SHPCreateObject(geometry); int result = SHPWriteObject(m_shp, -1, obj ); @@ -104,20 +113,14 @@ public : inline void AddField(std::string const& name, int width = 16, int decimals = 0) { ::DBFAddField(m_dbf, name.c_str(), - detail::DBFFieldType - < - typename boost::promote::type - >::value, + detail::DBFFieldType>::value, width, decimals); } template inline void WriteField(int row_index, int field_index, T const& value) { - detail::DBFWriteAttribute - < - typename boost::promote::type - >::apply(m_dbf, row_index, field_index, value); + detail::DBFWriteAttribute>::apply(m_dbf, row_index, field_index, value); } inline void SetSrid(int srid) 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..afdff94a38 100644 --- a/include/boost/geometry/extensions/gis/io/shapelib/shape_reader.hpp +++ b/include/boost/geometry/extensions/gis/io/shapelib/shape_reader.hpp @@ -13,9 +13,6 @@ #include "shapefil.h" -#include -#include - #include @@ -29,7 +26,7 @@ namespace detail template -class shape_reader : public boost::noncopyable +class shape_reader { public : shape_reader(std::string const& name) @@ -54,8 +51,8 @@ public : inline int count() const { return m_count; } - - + shape_reader(shape_reader const&) = delete; // Not copyable. + shape_reader& operator=(shape_reader const&) = delete; private : ::SHPHandle m_shp; 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..390ab096e4 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/detail/endian.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/detail/endian.hpp @@ -24,13 +24,12 @@ #include #include -#include #include +#include +#include #include #include -#include -#include #include #if CHAR_BIT != 8 @@ -147,7 +146,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, + "Range value_type must be signed."); *bytes = static_cast(value); } @@ -155,7 +155,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, + "Range value_type must be signed."); *(bytes - 1) = static_cast(value); } @@ -243,7 +244,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 +254,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..f358c59dc8 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 { @@ -113,12 +113,12 @@ template > struct geometry_type_impl { - static bool check(boost::uint32_t value) + static bool check(std::uint32_t value) { return value == get(); } - static boost::uint32_t get() + static std::uint32_t get() { return OgcType; } @@ -131,12 +131,12 @@ template > struct geometry_type_impl { - static bool check(boost::uint32_t value) + static bool check(std::uint32_t value) { return value == get(); } - static boost::uint32_t get() + static std::uint32_t get() { return 1000 + OgcType; } 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..7097e12d4e 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -23,8 +24,6 @@ #include #include -#include -#include #include #include @@ -67,13 +66,14 @@ struct value_parser 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) - )); + static_assert( + std::is_integral::value_type>::value, + "Input range value_type must be integral." + ); + static_assert(sizeof(std::uint8_t) == + sizeof(typename std::iterator_traits::value_type), + "Input range value_type must have same width as std::uint8_t." + ); typedef typename std::iterator_traits::difference_type diff_type; diff_type const required_size = sizeof(T); @@ -110,8 +110,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 +132,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); } @@ -210,14 +210,14 @@ struct point_container_parser { typedef typename point_type::type point_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)() ) + if(num_points > (std::numeric_limits::max)() ) { throw boost::geometry::read_wkb_exception(); } @@ -285,8 +285,8 @@ 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; } 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..5e2f2d3343 100644 --- a/include/boost/geometry/extensions/gis/io/wkb/detail/writer.hpp +++ b/include/boost/geometry/extensions/gis/io/wkb/detail/writer.hpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include 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..47a9d864a0 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 @@ -73,13 +72,13 @@ struct read_wkb 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)); + >::value, + "Stream of bytes can only be parsed using random access iterator."); detail::wkb::byte_order_type::enum_t byte_order; if (detail::wkb::byte_order_parser::parse(begin, end, byte_order)) @@ -97,8 +96,8 @@ 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, "Byte type must be integral"); + static_assert(sizeof(std::uint8_t) == sizeof(ByteType), "Byte type must have same width as 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..e0a6424712 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 @@ -33,10 +31,10 @@ namespace boost { namespace geometry template bool hex2wkb(std::string const& hex, OutputIterator bytes) { - // Bytes can be only written to output iterator. - BOOST_STATIC_ASSERT((std::is_convertible< + static_assert(std::is_convertible< typename std::iterator_traits::iterator_category, - const std::output_iterator_tag&>::value)); + const std::output_iterator_tag&>::value, + "Bytes can only be written to output iterator."); std::string::size_type const byte_size = 2; if (0 != hex.size() % byte_size) @@ -54,7 +52,7 @@ bool hex2wkb(std::string const& hex, OutputIterator bytes) { return false; } - *bytes = static_cast(byte); + *bytes = static_cast(byte); ++bytes; } @@ -64,10 +62,10 @@ bool hex2wkb(std::string const& hex, OutputIterator bytes) 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< + static_assert(std::is_convertible< typename std::iterator_traits::iterator_category, - const std::random_access_iterator_tag&>::value)); + const std::random_access_iterator_tag&>::value, + "Stream of bytes can only be passed using random access iterator."); const char hexalpha[] = "0123456789ABCDEF"; char hexbyte[3] = { 0 }; @@ -76,7 +74,7 @@ bool wkb2hex(Iterator begin, Iterator end, std::string& hex) Iterator it = begin; while (it != end) { - boost::uint8_t byte = static_cast(*it); + std::uint8_t 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..d41f33560e 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,13 @@ 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, + "The provided iterator must be an output iterator."); // Will write in the native byte order #ifdef BOOST_BIG_ENDIAN diff --git a/include/boost/geometry/extensions/multi/gis/io/wkb/detail/parser.hpp b/include/boost/geometry/extensions/multi/gis/io/wkb/detail/parser.hpp index 136d06ed45..c2a94f097d 100644 --- a/include/boost/geometry/extensions/multi/gis/io/wkb/detail/parser.hpp +++ b/include/boost/geometry/extensions/multi/gis/io/wkb/detail/parser.hpp @@ -10,6 +10,7 @@ #define BOOST_GEOMETRY_MULTI_IO_WKB_DETAIL_PARSER_HPP #include +#include #include #include @@ -44,8 +45,8 @@ struct multipoint_parser return false; } - 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; } @@ -58,8 +59,8 @@ struct multipoint_parser typedef typename point_type::type point_type; size_type const container_byte_size = dimension::value * num_points * sizeof(double) - + num_points * sizeof(boost::uint8_t) - + num_points * sizeof(boost::uint32_t); + + num_points * sizeof(std::uint8_t) + + num_points * sizeof(std::uint32_t); size_type const stream_byte_size = std::distance(it,end); @@ -72,7 +73,7 @@ struct multipoint_parser std::back_insert_iterator output(std::back_inserter(multipoint)); typedef typename std::iterator_traits::difference_type size_type; - if(num_points > (std::numeric_limits::max)() ) + if(num_points > (std::numeric_limits::max)() ) { throw boost::geometry::read_wkb_exception(); } @@ -116,8 +117,8 @@ struct multilinestring_parser return false; } - boost::uint32_t num_linestrings(0); - if (!value_parser::parse(it, end, num_linestrings, order)) + std::uint32_t num_linestrings(0); + if (!value_parser::parse(it, end, num_linestrings, order)) { return false; } @@ -125,7 +126,7 @@ struct multilinestring_parser std::back_insert_iterator output(std::back_inserter(multilinestring)); typedef typename std::iterator_traits::difference_type size_type; - if(num_linestrings > (std::numeric_limits::max)() ) + if(num_linestrings > (std::numeric_limits::max)() ) { throw boost::geometry::read_wkb_exception(); } @@ -173,8 +174,8 @@ struct multipolygon_parser return false; } - boost::uint32_t num_polygons(0); - if (!value_parser::parse(it, end, num_polygons, order)) + std::uint32_t num_polygons(0); + if (!value_parser::parse(it, end, num_polygons, order)) { return false; } @@ -197,8 +198,8 @@ struct multipolygon_parser return false; } - boost::uint32_t num_rings(0); - if (!value_parser::parse(it, end, num_rings, polygon_byte_order)) + std::uint32_t num_rings(0); + if (!value_parser::parse(it, end, num_rings, polygon_byte_order)) { return false; } 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..5effeaa3f9 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 @@ -24,7 +24,6 @@ #include #include #include -#include #include diff --git a/include/boost/geometry/extensions/nsphere/core/radius.hpp b/include/boost/geometry/extensions/nsphere/core/radius.hpp index 080f1dca9b..c0ab8f338c 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 out of bounds."); }; } // namespace core_dispatch 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..ce8929b0a1 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, "Must be volumetric or higher-dimensional."); 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..3e478c89d6 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 at least 2."); //BOOST_STATIC_ASSERT(Dimension <= dimension::value); static inline typename default_margin_result::type apply(NSphere const& s) 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/adapted/boost_polygon/ring_proxy.hpp b/include/boost/geometry/geometries/adapted/boost_polygon/ring_proxy.hpp index f79a995e84..d069b4bb13 100644 --- a/include/boost/geometry/geometries/adapted/boost_polygon/ring_proxy.hpp +++ b/include/boost/geometry/geometries/adapted/boost_polygon/ring_proxy.hpp @@ -18,6 +18,8 @@ // boost::polygon::polygon_with_holes_data -> boost::geometry::polygon // pair{begin_points, end_points} -> ring_proxy +#include + #include #include #include @@ -80,15 +82,15 @@ class ring_proxy public : typedef typename boost::polygon::polygon_traits < - typename boost::remove_const::type + typename std::remove_const::type >::iterator_type iterator_type; typedef typename boost::polygon::polygon_with_holes_traits < - typename boost::remove_const::type + typename std::remove_const::type >::iterator_holes_type hole_iterator_type; - static const bool is_mutable = !boost::is_const::type::value; + static const bool is_mutable = !std::is_const::value; inline ring_proxy(Polygon& p) : m_polygon_pointer(&p) diff --git a/include/boost/geometry/geometries/concepts/polyhedral_surface_concept.hpp b/include/boost/geometry/geometries/concepts/polyhedral_surface_concept.hpp index b051256210..e264c66b98 100644 --- a/include/boost/geometry/geometries/concepts/polyhedral_surface_concept.hpp +++ b/include/boost/geometry/geometries/concepts/polyhedral_surface_concept.hpp @@ -33,9 +33,11 @@ class PolyhedralSurface BOOST_CONCEPT_ASSERT( (concepts::Polygon) ); BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept) ); - BOOST_STATIC_ASSERT( (geometry::dimension::value == 3) ); - BOOST_STATIC_ASSERT( (std::is_same, - geometry::cartesian_tag>::value) ); + static_assert(geometry::dimension::value == 3, + "PolyhedralSurface must be 3-dimensional"); + static_assert( + std::is_same, geometry::cartesian_tag>::value, + "PolyhedralSurface must be cartesian."); public: @@ -60,9 +62,11 @@ class ConstPolyhedralSurface BOOST_CONCEPT_ASSERT( (concepts::ConstPolygon) ); BOOST_CONCEPT_ASSERT( (boost::RandomAccessRangeConcept) ); - BOOST_STATIC_ASSERT( (geometry::dimension::value == 3) ); - BOOST_STATIC_ASSERT( (std::is_same, - geometry::cartesian_tag>::value) ); + static_assert(geometry::dimension::value == 3, + "PolyhedralSurface must be 3-dimensional"); + static_assert( + std::is_same, geometry::cartesian_tag>::value, + "PolyhedralSurface must be cartesian."); public: diff --git a/include/boost/geometry/geometries/point.hpp b/include/boost/geometry/geometries/point.hpp index 6a9e7c0b5d..a6cac1f794 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, "Point dimension 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, "Coordinate dimension out of bounds."); 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, "Coordinate dimension out of bounds."); m_values[K] = value; } diff --git a/include/boost/geometry/geometries/pointing_segment.hpp b/include/boost/geometry/geometries/pointing_segment.hpp index 48c8adfa6e..415f137b87 100644 --- a/include/boost/geometry/geometries/pointing_segment.hpp +++ b/include/boost/geometry/geometries/pointing_segment.hpp @@ -12,10 +12,10 @@ #define BOOST_GEOMETRY_GEOMETRIES_POINTING_SEGMENT_HPP #include +#include #include #include -#include #include #include @@ -61,8 +61,8 @@ class pointing_segment {} inline pointing_segment(point_type const& p1, point_type const& p2) - : first(boost::addressof(p1)) - , second(boost::addressof(p2)) + : first(std::addressof(p1)) + , second(std::addressof(p2)) {} }; diff --git a/include/boost/geometry/index/detail/algorithms/content.hpp b/include/boost/geometry/index/detail/algorithms/content.hpp index 2ea13dd00a..4bfd35786d 100644 --- a/include/boost/geometry/index/detail/algorithms/content.hpp +++ b/include/boost/geometry/index/detail/algorithms/content.hpp @@ -16,6 +16,8 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_CONTENT_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_ALGORITHMS_CONTENT_HPP +#include + #include #include @@ -56,7 +58,7 @@ template ::value> struct content_box { - BOOST_STATIC_ASSERT(0 < CurrentDimension); + static_assert(0 < CurrentDimension, "Specialisation for positive index."); 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..193f65d797 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, "Specialisation for positive index."); 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..49b344e0d9 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, "Box dimension must be non-negative."); + static_assert(0 <= dimension::value, "Point dimension must be non-negative."); + static_assert(I < size_t(dimension::value), "Index out of bounds for Box."); + static_assert(I < size_t(dimension::value), "Index out of bounds for Point."); + static_assert(dimension::value == dimension::value, "Point and Box dimension must be equal."); // WARNING! - RelativeDistance must be IEEE float for this to work @@ -77,7 +77,7 @@ struct box_segment_intersection_dim template struct box_segment_intersection { - BOOST_STATIC_ASSERT(0 < CurrentDimension); + static_assert(0 < CurrentDimension, "Specialisation for positive index."); typedef box_segment_intersection_dim for_dim; 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..16d7a6d8bb 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 { 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..e31a62e475 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 { diff --git a/include/boost/geometry/index/detail/rtree/iterators.hpp b/include/boost/geometry/index/detail/rtree/iterators.hpp index 2a26bd6d50..f71aefac64 100644 --- a/include/boost/geometry/index/detail/rtree/iterators.hpp +++ b/include/boost/geometry/index/detail/rtree/iterators.hpp @@ -16,6 +16,7 @@ #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_ITERATORS_HPP #include +#include #include @@ -90,7 +91,7 @@ class iterator const value_type * operator->() const { - return boost::addressof(m_visitor.dereference()); + return std::addressof(m_visitor.dereference()); } iterator & operator++() 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 7c4dcc0f78..dc786a273e 100644 --- a/include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp +++ b/include/boost/geometry/index/detail/rtree/linear/redistribute_elements.hpp @@ -242,7 +242,7 @@ 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/node/variant_dynamic.hpp b/include/boost/geometry/index/detail/rtree/node/variant_dynamic.hpp index ba0fd7c9ac..2b7097e283 100644 --- a/include/boost/geometry/index/detail/rtree/node/variant_dynamic.hpp +++ b/include/boost/geometry/index/detail/rtree/node/variant_dynamic.hpp @@ -16,7 +16,9 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_VARIANT_DYNAMIC_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_VARIANT_DYNAMIC_HPP +#include #include + #include #include #include @@ -234,7 +236,7 @@ struct destroy_variant_node { typedef boost::container::allocator_traits Al; - Al::destroy(alloc_node, boost::addressof(*n)); + Al::destroy(alloc_node, std::addressof(*n)); Al::deallocate(alloc_node, n, 1); } }; diff --git a/include/boost/geometry/index/detail/rtree/node/weak_dynamic.hpp b/include/boost/geometry/index/detail/rtree/node/weak_dynamic.hpp index 6db7161ee9..d03fdac052 100644 --- a/include/boost/geometry/index/detail/rtree/node/weak_dynamic.hpp +++ b/include/boost/geometry/index/detail/rtree/node/weak_dynamic.hpp @@ -16,6 +16,8 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_WEAK_DYNAMIC_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_NODE_WEAK_DYNAMIC_HPP +#include + #include #include #include @@ -281,7 +283,7 @@ struct destroy_weak_node typedef typename Al::pointer P; P p(&static_cast(rtree::get(*n))); - Al::destroy(alloc_node, boost::addressof(*p)); + Al::destroy(alloc_node, std::addressof(*p)); Al::deallocate(alloc_node, p, 1); } }; diff --git a/include/boost/geometry/index/detail/rtree/pack_create.hpp b/include/boost/geometry/index/detail/rtree/pack_create.hpp index ee517ca996..aab0ec9bd8 100644 --- a/include/boost/geometry/index/detail/rtree/pack_create.hpp +++ b/include/boost/geometry/index/detail/rtree/pack_create.hpp @@ -40,7 +40,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) { diff --git a/include/boost/geometry/index/detail/rtree/query_iterators.hpp b/include/boost/geometry/index/detail/rtree/query_iterators.hpp index 6fc5253f42..3e9552682d 100644 --- a/include/boost/geometry/index/detail/rtree/query_iterators.hpp +++ b/include/boost/geometry/index/detail/rtree/query_iterators.hpp @@ -95,7 +95,7 @@ class spatial_query_iterator const value_type * operator->() const { - return boost::addressof(m_impl.dereference()); + return std::addressof(m_impl.dereference()); } spatial_query_iterator & operator++() @@ -161,7 +161,7 @@ class distance_query_iterator const value_type * operator->() const { - return boost::addressof(m_impl.dereference()); + return std::addressof(m_impl.dereference()); } distance_query_iterator & operator++() @@ -247,7 +247,7 @@ class query_iterator_wrapper virtual void increment() { ++m_iterator; } virtual bool equals(base_t const& r) const { - const query_iterator_wrapper * p = dynamic_cast(boost::addressof(r)); + const query_iterator_wrapper * p = dynamic_cast(std::addressof(r)); BOOST_GEOMETRY_INDEX_ASSERT(p, "iterators can't be compared"); return m_iterator == p->m_iterator; } @@ -289,7 +289,7 @@ class query_iterator query_iterator & operator=(query_iterator const& o) { - if ( this != boost::addressof(o) ) + if ( this != std::addressof(o) ) { m_ptr.reset(o.m_ptr.get() ? o.m_ptr->clone() : 0); } @@ -305,7 +305,7 @@ class query_iterator const value_type * operator->() const { - return boost::addressof(m_ptr->dereference()); + return std::addressof(m_ptr->dereference()); } query_iterator & operator++() 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 e9084a3a0a..9b829a862d 100644 --- a/include/boost/geometry/index/detail/rtree/rstar/redistribute_elements.hpp +++ b/include/boost/geometry/index/detail/rtree/rstar/redistribute_elements.hpp @@ -17,8 +17,6 @@ #include -#include - #include #include #include @@ -275,7 +273,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 +358,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, "Index out of bounds."); 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..c033805a17 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/distance_query.hpp b/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp index de2f68f88a..465b20894c 100644 --- a/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp +++ b/include/boost/geometry/index/detail/rtree/visitors/distance_query.hpp @@ -16,6 +16,7 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_DISTANCE_QUERY_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_DISTANCE_QUERY_HPP +#include #include #include @@ -260,7 +261,7 @@ class distance_query && calculate_value_distance::apply(predicate(), m_tr(v), m_strategy, value_distance)) { // store value - store_value(value_distance, boost::addressof(v)); + store_value(value_distance, std::addressof(v)); } } } @@ -397,7 +398,7 @@ class distance_query_incremental {} inline distance_query_incremental(MembersHolder const& members, Predicates const& pred) - : m_tr(::boost::addressof(members.translator())) + : m_tr(std::addressof(members.translator())) , m_strategy(index::detail::get_strategy(members.parameters())) , m_pred(pred) , m_neighbors_count(0) @@ -529,7 +530,7 @@ class distance_query_incremental && ! ignore_branch_or_value(value_distance)) { // add current value into the queue - m_neighbors.push(std::make_pair(value_distance, boost::addressof(v))); + m_neighbors.push(std::make_pair(value_distance, std::addressof(v))); // remove unneeded value if (m_neighbors_count + m_neighbors.size() > max_count()) diff --git a/include/boost/geometry/index/detail/rtree/visitors/iterator.hpp b/include/boost/geometry/index/detail/rtree/visitors/iterator.hpp index 07f4bcc9b3..d63ae9ad1e 100644 --- a/include/boost/geometry/index/detail/rtree/visitors/iterator.hpp +++ b/include/boost/geometry/index/detail/rtree/visitors/iterator.hpp @@ -16,6 +16,8 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_ITERATOR_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_VISITORS_ITERATOR_HPP +#include + #include #include #include @@ -56,7 +58,7 @@ class iterator inline void operator()(leaf const& n) { - m_values = ::boost::addressof(rtree::elements(n)); + m_values = std::addressof(rtree::elements(n)); m_current = rtree::elements(n).begin(); } diff --git a/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp b/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp index 9cabcf963a..59105efd6c 100644 --- a/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp +++ b/include/boost/geometry/index/detail/rtree/visitors/spatial_query.hpp @@ -149,7 +149,7 @@ class spatial_query_incremental {} spatial_query_incremental(MembersHolder const& members, Predicates const& p) - : m_translator(::boost::addressof(members.translator())) + : m_translator(std::addressof(members.translator())) , m_strategy(index::detail::get_strategy(members.parameters())) , m_pred(p) , m_values(nullptr) @@ -198,7 +198,7 @@ class spatial_query_incremental else { leaf& n = rtree::get(*ptr); - m_values = ::boost::addressof(rtree::elements(n)); + m_values = std::addressof(rtree::elements(n)); m_current = rtree::elements(n).begin(); } } diff --git a/include/boost/geometry/index/detail/serialization.hpp b/include/boost/geometry/index/detail/serialization.hpp index a2de9f18f0..4506a8c1c7 100644 --- a/include/boost/geometry/index/detail/serialization.hpp +++ b/include/boost/geometry/index/detail/serialization.hpp @@ -14,8 +14,7 @@ #ifndef BOOST_GEOMETRY_INDEX_DETAIL_SERIALIZATION_HPP #define BOOST_GEOMETRY_INDEX_DETAIL_SERIALIZATION_HPP -#include -#include +#include #include #include @@ -65,10 +64,10 @@ class serialization_storage } T * address() { - return static_cast(m_storage.address()); + return reinterpret_cast(&m_storage); } private: - boost::aligned_storage::value> m_storage; + alignas(T) unsigned char m_storage[sizeof(T)]; }; // TODO - save and load item_version? see: collections_load_imp and collections_save_imp @@ -89,7 +88,7 @@ template inline void serialization_save(T const& t, const char * name, Archive & ar) { namespace bs = boost::serialization; - bs::save_construct_data_adl(ar, boost::addressof(t), bs::version::value); // save_construct_data + bs::save_construct_data_adl(ar, std::addressof(t), bs::version::value); // save_construct_data ar << boost::serialization::make_nvp(name, t); // serialize //ar << t; // serialize } diff --git a/include/boost/geometry/io/svg/svg_mapper.hpp b/include/boost/geometry/io/svg/svg_mapper.hpp index fdfa7732d0..4e3fc93aa0 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,8 @@ public : write_header(width_height); } + svg_mapper(svg_mapper const&) = delete; // Not copyable. + /*! \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..e521ac100c 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 a ring."); inline stateful_range_appender() : pt_index(0) diff --git a/include/boost/geometry/srs/projections/grids.hpp b/include/boost/geometry/srs/projections/grids.hpp index 315ac4a06a..82349b5e72 100644 --- a/include/boost/geometry/srs/projections/grids.hpp +++ b/include/boost/geometry/srs/projections/grids.hpp @@ -12,6 +12,8 @@ #define BOOST_GEOMETRY_SRS_PROJECTIONS_GRIDS_HPP +#include + #include #include @@ -89,7 +91,7 @@ class projection_grids { public: projection_grids(GridsStorage & storage) - : m_storage_ptr(boost::addressof(storage)) + : m_storage_ptr(std::addressof(storage)) {} typedef GridsStorage grids_storage_type; diff --git a/include/boost/geometry/srs/projections/impl/dms_parser.hpp b/include/boost/geometry/srs/projections/impl/dms_parser.hpp index 02e26b7287..b8f30fe7b9 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 @@ -102,10 +100,8 @@ struct dms_parser // We have to change the switch then -> specializations // 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. -#endif + static constexpr int diff = 'a' - 'A'; + static_assert(diff > 0, "Character set must be case-sensitive."); static const char n_alter = N <= 'Z' ? N + diff : N - diff; static const char e_alter = E <= 'Z' ? E + diff : E - diff; static const char s_alter = S <= 'Z' ? S + diff : S - diff; diff --git a/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp b/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp index 3d1db4c065..0665c49b63 100644 --- a/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_apply_gridshift.hpp @@ -41,6 +41,9 @@ #define BOOST_GEOMETRY_SRS_PROJECTIONS_IMPL_PJ_APPLY_GRIDSHIFT_HPP +#include +#include + #include #include @@ -65,7 +68,7 @@ inline void nad_intr(CalcT in_lon, CalcT in_lat, { pj_ctable::lp_t frct; pj_ctable::ilp_t indx; - boost::int32_t in; + std::int32_t in; indx.lam = int_floor(in_lon /= ct.del.lam); indx.phi = int_floor(in_lat /= ct.del.phi); @@ -99,7 +102,7 @@ inline void nad_intr(CalcT in_lon, CalcT in_lat, } else return; } - boost::int32_t index = indx.phi * ct.lim.lam + indx.lam; + std::int32_t index = indx.phi * ct.lim.lam + indx.lam; pj_ctable::flp_t const& f00 = ct.cvs[index++]; pj_ctable::flp_t const& f10 = ct.cvs[index]; index += ct.lim.lam; @@ -247,7 +250,7 @@ inline pj_gi * find_grid(T const& lam, // skip vertical grids if (first->format != pj_gi::gtx) { - gip = boost::addressof(*first); + gip = std::addressof(*first); break; } } @@ -284,7 +287,7 @@ inline pj_gi * find_grid(T const& lam, // skip vertical grids if (gi.format != pj_gi::gtx) { - gip = boost::addressof(gi); + gip = std::addressof(gi); break; } } diff --git a/include/boost/geometry/srs/projections/impl/pj_auth.hpp b/include/boost/geometry/srs/projections/impl/pj_auth.hpp index 8a9e34a09c..52e7a0b98f 100644 --- a/include/boost/geometry/srs/projections/impl/pj_auth.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_auth.hpp @@ -41,6 +41,7 @@ #include #include +#include #include diff --git a/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp b/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp index 2822fe6959..e223283579 100644 --- a/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_gridinfo.hpp @@ -43,16 +43,16 @@ #define BOOST_GEOMETRY_SRS_PROJECTIONS_IMPL_PJ_GRIDINFO_HPP +#include +#include +#include +#include + #include #include #include #include -#include - -#include -#include -#include namespace boost { namespace geometry { namespace projections @@ -106,7 +106,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 +127,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; + typedef std::intmax_t offset_t; explicit pj_gi_load(std::string const& gname = "", format_t f = missing, @@ -277,7 +277,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 +291,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 +327,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 +343,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 +366,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 +477,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, "std::int32_t must have 4 bytes width."); + static_assert(sizeof(double) == 8, "Double must have 8 bytes width."); static const double s2r = math::d2r() / 3600.0; @@ -516,11 +516,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 +561,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 +629,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, "std::int32_t must have 4 bytes width."); + static_assert(sizeof(double) == 8, "double must have 8 bytes width."); static const double d2r = math::d2r(); @@ -656,7 +656,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 +679,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 +706,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, "std::int32_t must have 4 bytes width"); + static_assert(sizeof(double) == 8, "double must have 8 bytes width."); static const double d2r = math::d2r(); @@ -722,7 +722,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 +793,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, "std::int32_t must have 4 bytes width"); + static_assert(sizeof(double) == 8, "double must have 8 bytes width."); char header[160]; @@ -858,8 +858,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, "std::int32_t must have 4 bytes width."); + static_assert(sizeof(double) == 8, "Double must have 8 bytes width."); // 80 + 2*8 + 2*8 + 2*4 char header[120]; diff --git a/include/boost/geometry/srs/projections/impl/pj_param.hpp b/include/boost/geometry/srs/projections/impl/pj_param.hpp index 3ff1b06d15..f9ba669875 100644 --- a/include/boost/geometry/srs/projections/impl/pj_param.hpp +++ b/include/boost/geometry/srs/projections/impl/pj_param.hpp @@ -41,6 +41,7 @@ #include +#include #include #include #include @@ -113,7 +114,7 @@ struct pj_param_find_static typedef const type* result_type; static result_type get(StaticParams const& params) { - return boost::addressof(boost::get(params)); + return std::addressof(boost::get(params)); } }; 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..a9f90b63d2 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, "Cannot get radius for dimensions >= 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, "Cannot set radius for dimensions >= 3."); m_r = radius; } diff --git a/include/boost/geometry/srs/spheroid.hpp b/include/boost/geometry/srs/spheroid.hpp index f8e5b51816..ba482d13ab 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 out of bounds."); 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 out of bounds."); (I < 2 ? m_a : m_b) = radius; } diff --git a/include/boost/geometry/srs/transformation.hpp b/include/boost/geometry/srs/transformation.hpp index 64f9873c57..df88d5f005 100644 --- a/include/boost/geometry/srs/transformation.hpp +++ b/include/boost/geometry/srs/transformation.hpp @@ -11,6 +11,7 @@ #define BOOST_GEOMETRY_SRS_TRANSFORMATION_HPP +#include #include #include @@ -50,7 +51,7 @@ inline bool same_object(T1 const& , T2 const& ) template inline bool same_object(T const& o1, T const& o2) { - return boost::addressof(o1) == boost::addressof(o2); + return std::addressof(o1) == std::addressof(o2); } template @@ -402,7 +403,7 @@ struct transform transform_geometry_wrapper wrapper(in, out, input_angles); typedef typename transform_geometry_wrapper::type point_type; - point_type * ptr = boost::addressof(wrapper.get()); + point_type * ptr = std::addressof(wrapper.get()); std::pair range = std::make_pair(ptr, ptr + 1); diff --git a/include/boost/geometry/strategies/buffer.hpp b/include/boost/geometry/strategies/buffer.hpp index b03c9bc626..434c0cacb8 100644 --- a/include/boost/geometry/strategies/buffer.hpp +++ b/include/boost/geometry/strategies/buffer.hpp @@ -9,7 +9,7 @@ #ifndef BOOST_GEOMETRY_STRATEGIES_BUFFER_HPP #define BOOST_GEOMETRY_STRATEGIES_BUFFER_HPP -#include +#include namespace boost { namespace geometry { diff --git a/include/boost/geometry/util/calculation_type.hpp b/include/boost/geometry/util/calculation_type.hpp index bc140b4cd9..e88f962427 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 @@ -53,18 +51,18 @@ template > struct calculation_type { - BOOST_STATIC_ASSERT(( + static_assert( std::is_fundamental < DefaultFloatingPointCalculationType - >::value - )); - BOOST_STATIC_ASSERT(( + >::value, + "DefaultFloatingPointCalculationType must be fundamental."); + static_assert( std::is_fundamental < DefaultIntegralCalculationType - >::value - )); + >::value, + "DefaultIntegralCalculationType must be fundamental."); typedef std::conditional_t diff --git a/include/boost/geometry/util/range.hpp b/include/boost/geometry/util/range.hpp index a25ac102e4..6854eb604a 100644 --- a/include/boost/geometry/util/range.hpp +++ b/include/boost/geometry/util/range.hpp @@ -14,11 +14,11 @@ #include #include +#include #include #include #include -#include #include #include #include @@ -390,7 +390,7 @@ class back_insert_iterator typedef Container container_type; explicit back_insert_iterator(Container & c) - : container(boost::addressof(c)) + : container(std::addressof(c)) {} back_insert_iterator & operator=(typename Container::value_type const& value) diff --git a/include/boost/geometry/util/series_expansion.hpp b/include/boost/geometry/util/series_expansion.hpp index 55c8b8f2fc..df89d7298e 100644 --- a/include/boost/geometry/util/series_expansion.hpp +++ b/include/boost/geometry/util/series_expansion.hpp @@ -30,12 +30,21 @@ #ifndef BOOST_GEOMETRY_UTIL_SERIES_EXPANSION_HPP #define BOOST_GEOMETRY_UTIL_SERIES_EXPANSION_HPP -#include +#include + #include #include namespace boost { namespace geometry { namespace series_expansion { + template + auto array_base_size_helper(std::array const*) + -> std::integral_constant; + + template + constexpr size_t static_size = + decltype(array_base_size_helper(static_cast(nullptr)))::value; + /* Generate and evaluate the series expansion of the following integral @@ -156,7 +165,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(static_size)) { case 0: break; @@ -228,7 +237,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(static_size) - 1) { case 0: break; @@ -328,7 +337,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(static_size) - 1) { case 0: break; @@ -428,7 +437,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(static_size) - 1) { case 0: break; @@ -525,7 +534,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((static_size == (SeriesOrder * (SeriesOrder - 1)) / 2)); CT const n2 = math::sqr(n); switch (SeriesOrder) @@ -648,10 +657,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 < static_size; ++i) { // Order of polynomial in eps. - size_t m = Coeffs1::static_size - i; + size_t m = static_size - i; mult *= eps; coeffs1[i] = mult * math::horner_evaluate(eps, coeffs2.begin() + offset, @@ -672,7 +681,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 = static_size - 1; size_t index = 0; // Point to one beyond last element. @@ -699,7 +708,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 +717,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 +726,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 +735,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 +744,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 +755,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/detail/boundary_view/implementation.hpp b/include/boost/geometry/views/detail/boundary_view/implementation.hpp index 78ea7fa6e4..7990873b97 100644 --- a/include/boost/geometry/views/detail/boundary_view/implementation.hpp +++ b/include/boost/geometry/views/detail/boundary_view/implementation.hpp @@ -20,7 +20,6 @@ #include #include -#include #include #include #include @@ -82,13 +81,13 @@ class polygon_rings_iterator // for begin polygon_rings_iterator(Polygon& polygon) - : m_polygon(boost::addressof(polygon)) + : m_polygon(std::addressof(polygon)) , m_index(0) {} // for end polygon_rings_iterator(Polygon& polygon, bool) - : m_polygon(boost::addressof(polygon)) + : m_polygon(std::addressof(polygon)) , m_index(static_cast(num_rings(polygon))) {} diff --git a/include/boost/geometry/views/detail/geometry_collection_view.hpp b/include/boost/geometry/views/detail/geometry_collection_view.hpp index be3c294711..5c12246e8d 100644 --- a/include/boost/geometry/views/detail/geometry_collection_view.hpp +++ b/include/boost/geometry/views/detail/geometry_collection_view.hpp @@ -10,7 +10,7 @@ #ifndef BOOST_GEOMETRY_VIEWS_GEOMETRY_COLLECTION_VIEW_HPP #define BOOST_GEOMETRY_VIEWS_GEOMETRY_COLLECTION_VIEW_HPP -#include +#include #include #include @@ -36,8 +36,8 @@ class geometry_collection_view : m_geometry(geometry) {} - const_iterator begin() const { return boost::addressof(m_geometry); } - const_iterator end() const { return boost::addressof(m_geometry) + 1; } + const_iterator begin() const { return std::addressof(m_geometry); } + const_iterator end() const { return std::addressof(m_geometry) + 1; } private: Geometry const& m_geometry; diff --git a/include/boost/geometry/views/enumerate_view.hpp b/include/boost/geometry/views/enumerate_view.hpp index 65f3beed90..1ded0f65d3 100644 --- a/include/boost/geometry/views/enumerate_view.hpp +++ b/include/boost/geometry/views/enumerate_view.hpp @@ -9,6 +9,8 @@ #ifndef BOOST_GEOMETRY_VIEWS_ENUMERATE_VIEW_HPP #define BOOST_GEOMETRY_VIEWS_ENUMERATE_VIEW_HPP +#include + #include #include #include diff --git a/index/test/rtree/rtree_values.cpp b/index/test/rtree/rtree_values.cpp index 74f916b780..6314fae2cf 100644 --- a/index/test/rtree/rtree_values.cpp +++ b/index/test/rtree/rtree_values.cpp @@ -7,9 +7,10 @@ // 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 +#include #include #include @@ -27,16 +28,16 @@ void check_convertible_to_value(Rtree const& rt, Convertible const& conv) { static const bool is_conv_to_indexable - = boost::is_convertible::value; + = std::is_convertible::value; static const bool is_conv_to_value - = boost::is_convertible::value; + = std::is_convertible::value; static const bool is_same_as_indexable - = boost::is_same::value; + = std::is_same::value; static const bool is_same_as_value - = boost::is_same::value; + = std::is_same::value; BOOST_CHECK_EQUAL(is_same_as_indexable, false); BOOST_CHECK_EQUAL(is_same_as_value, false); @@ -52,7 +53,7 @@ void test_pair() { typedef std::pair Value; - typename boost::remove_const::type box; + typename std::remove_const::type box; bg::assign_zero(box); Value val(box, 0); @@ -93,21 +94,21 @@ void test_pair_geom_ptr() typedef std::pair Value; - typename boost::remove_const::type box; + typename std::remove_const::type box; bg::assign_zero(box); polygon_t poly; - Value val(box, boost::addressof(poly)); + Value val(box, std::addressof(poly)); bgi::rtree rt; rt.insert(val); - rt.insert(std::make_pair(box, boost::addressof(poly))); + rt.insert(std::make_pair(box, std::addressof(poly))); BOOST_CHECK_EQUAL(rt.size(), 2u); BOOST_CHECK_EQUAL(rt.remove(val), 1u); - BOOST_CHECK_EQUAL(rt.remove(std::make_pair(box, boost::addressof(poly))), 1u); + BOOST_CHECK_EQUAL(rt.remove(std::make_pair(box, std::addressof(poly))), 1u); BOOST_CHECK_EQUAL(rt.size(), 0u); } diff --git a/test/algorithms/detail/visit.cpp b/test/algorithms/detail/visit.cpp index 851320429f..d51b287c06 100644 --- a/test/algorithms/detail/visit.cpp +++ b/test/algorithms/detail/visit.cpp @@ -55,76 +55,94 @@ void test_all() bg::detail::visit([](auto g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const::value); + static_assert(! std::is_const::value, + "Copy of mutable must be visited as mutable."); }, dg); bg::detail::visit([](auto const g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const::value); + static_assert(std::is_const::value, + "Const copy of mutable must be visited as const."); }, dg); bg::detail::visit([](auto & g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); + static_assert(! std::is_const>::value, + "Reference of mutable must be visited as mutable."); }, dg); bg::detail::visit([](auto const& g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); + static_assert(std::is_const>::value, + "Const reference of mutable must be visited as const."); }, dg); DynamicGeometry const cdg = point_t(3, 4); bg::detail::visit([](auto g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const::value); + static_assert(! std::is_const::value, + "Copy of const must be visited as mutable."); }, cdg); bg::detail::visit([](auto const g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const::value); + static_assert(std::is_const::value, + "Const copy of const must be visited as const."); }, cdg); bg::detail::visit([](auto & g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); + static_assert(std::is_const>::value, + "Reference of const must be visited as const."); }, cdg); bg::detail::visit([](auto const& g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); + static_assert(std::is_const>::value, + "Const reference of const must be visited as const."); }, cdg); bg::detail::visit([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Forward must remain mutable."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); }, dg); bg::detail::visit([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); + static_assert(std::is_const>::value, + "Forward of const must remain const."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); }, cdg); bg::detail::visit([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Moved from must remain mutable."); + static_assert(std::is_rvalue_reference::value, + "Moved from must dynamic geometry must be visited as rvalue reference."); }, std::move(dg)); bg::detail::visit([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(std::is_const>::value, + "Moved from must remain const."); + static_assert(std::is_rvalue_reference::value, + "Moved from const dynamic geometry must be visited as rvalue reference."); }, std::move(cdg)); bg::detail::visit([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Forwarded temporary dynamic geometry must be mutable."); + static_assert(std::is_rvalue_reference::value, + "Forwarded temporary dynamic geometry must be visited as rvalue reference."); }, DynamicGeometry{ point_t(1, 2) }); @@ -132,40 +150,56 @@ void test_all() { BOOST_CHECK(bg::util::is_point::value); BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Forward must remain mutable."); + static_assert(std::is_const>::value, + "Forward must remain const."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); }, dg, cdg); bg::detail::visit([](auto && g1, auto && g2) { BOOST_CHECK(bg::util::is_point::value); BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Moved from must remain mutable."); + static_assert(std::is_const>::value, + "Moved from must remain const."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference"); }, std::move(dg), std::move(cdg)); bg::detail::visit([](auto && g1, auto && g2) { BOOST_CHECK(bg::util::is_point::value); BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(!std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(!std::is_rvalue_reference::value); - BOOST_STATIC_ASSERT(!std::is_rvalue_reference::value); + static_assert(!std::is_const>::value, + "Forward must remain mutable."); + static_assert(std::is_const>::value, + "Forward must remain const."); + static_assert(!std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); + static_assert(!std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); }, cdg, dg); bg::detail::visit([](auto && g1, auto && g2) { BOOST_CHECK(bg::util::is_point::value); BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(!std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(!std::is_const>::value, + "Moved from must remain mutable."); + static_assert(std::is_const>::value, + "Moved from must remain const."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference."); }, std::move(cdg), std::move(dg)); @@ -175,32 +209,40 @@ void test_all() bg::detail::visit_breadth_first([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Forward must remain mutable."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); return true; }, gc); bg::detail::visit_breadth_first([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); + static_assert(std::is_const>::value, + "Forward must remain const."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); return true; }, cgc); bg::detail::visit_breadth_first([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Moved from must remain mutable."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference."); return true; }, std::move(gc)); bg::detail::visit_breadth_first([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(std::is_const>::value, + "Moved from must remain const."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference."); return true; }, std::move(cgc)); } diff --git a/test/algorithms/distance/distance.cpp b/test/algorithms/distance/distance.cpp index da260cb5e0..246f10fddd 100644 --- a/test/algorithms/distance/distance.cpp +++ b/test/algorithms/distance/distance.cpp @@ -17,13 +17,12 @@ //#include +#include #include #include #include "test_distance.hpp" -#include - #include #include #include @@ -42,7 +41,7 @@ BOOST_GEOMETRY_REGISTER_BOOST_TUPLE_CS(cs::cartesian) namespace boost { namespace geometry { namespace traits { template -struct tag< boost::array > +struct tag< std::array > { typedef linestring_tag type; }; @@ -197,7 +196,7 @@ void test_distance_array_as_linestring() typedef typename bg::default_distance_result

::type return_type; // Normal array does not have - boost::array points; + std::array points; bg::set<0>(points[0], 1); bg::set<1>(points[0], 1); bg::set<0>(points[1], 3); @@ -367,8 +366,8 @@ void test_all() // Should (currently) give compiler assertion // test_geometry, bg::model::polygon

>(donut, donut, 0.5 * sqrt(2.0)); - // DOES NOT COMPILE - cannot do read_wkt (because boost::array is not variably sized) - // test_geometry >("POINT(3 1)", "LINESTRING(1 1,4 4)", sqrt(2.0)); + // DOES NOT COMPILE - cannot do read_wkt (because std::array is not variably sized) + // test_geometry >("POINT(3 1)", "LINESTRING(1 1,4 4)", sqrt(2.0)); test_geometry >("POINT(3 1)", "LINESTRING(1 1,4 4)", sqrt(2.0)); diff --git a/test/algorithms/is_valid.cpp b/test/algorithms/is_valid.cpp index 9816f108ab..771523c53c 100644 --- a/test/algorithms/is_valid.cpp +++ b/test/algorithms/is_valid.cpp @@ -18,6 +18,7 @@ #include #include +#include #include @@ -1294,7 +1295,7 @@ BOOST_AUTO_TEST_CASE( test_is_valid_multipolygon ) template inline void check_one(Geometry const& geometry) { - bool const is_fp = boost::is_floating_point::value; + bool const is_fp = std::is_floating_point::value; bg::validity_failure_type failure; bool validity = bg::is_valid(geometry, failure); 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/algorithms/overlay/get_turns_linear_linear.cpp b/test/algorithms/overlay/get_turns_linear_linear.cpp index 425f390c5b..500d55fa41 100644 --- a/test/algorithms/overlay/get_turns_linear_linear.cpp +++ b/test/algorithms/overlay/get_turns_linear_linear.cpp @@ -17,6 +17,8 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +#include + #include "test_get_turns.hpp" #include @@ -262,7 +264,7 @@ void test_all() "LINESTRING(-5 -4,3 0,7 -4,2 -1)", expected("tii++")("mxu==")("miu==")("mui=+")); - if ( BOOST_GEOMETRY_CONDITION((boost::is_same::value)) ) + if ( BOOST_GEOMETRY_CONDITION((std::is_same::value)) ) { // BUG - the operations are correct but IP coordinates are wrong // ok now also the 3rd turn is wrong diff --git a/test/algorithms/relate/relate_linear_areal.cpp b/test/algorithms/relate/relate_linear_areal.cpp index 60617ae265..337cc32b4f 100644 --- a/test/algorithms/relate/relate_linear_areal.cpp +++ b/test/algorithms/relate/relate_linear_areal.cpp @@ -12,6 +12,8 @@ // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) +#include + #include "test_relate.hpp" #include "nan_cases.hpp" @@ -391,7 +393,7 @@ void test_multi_linestring_polygon() "1F10F0212"); if ( BOOST_GEOMETRY_CONDITION(( - boost::is_same::value )) ) + std::is_same::value )) ) { // assertion failure in 1.57 test_geometry("MULTILINESTRING((-0.59322033898305082 -8.0508474576271194,-2.882352941176471 -7.7647058823529411,-2.8823529411764706 -7.7647058823529411,-3.7361111111111112 -6.5694444444444446,-3.4404145077720205 -5.766839378238342,-4.1864406779661012 -3.6779661016949152,-7.5252525252525251 -5.5858585858585865,-7.5862068965517242 -5.1896551724137936,-4.47887323943662 -2.859154929577465,-4.5789473684210531 -2.5789473684210527,-3 -1,-2.9310344827586206 -0.86206896551724144,-3.1764705882352944 -0.70588235294117663,-4.7401960784313726 -2.1274509803921577,-5.3255813953488369 -0.48837209302325502,-4.7872340425531918 0.31914893617021284,-5.8571428571428577 1.0000000000000007,-5.3255813953488369 -0.48837209302325502,-5.9473684210526319 -1.4210526315789465,-8 2,-7.7333333333333334 2.1939393939393939,-8.8294573643410867 2.891472868217055,-8.8556701030927822 3.061855670103093,-7.5999999999999996 3.6000000000000001,-7.7999999999999998 3.7999999999999998,-7.75 3.7916666666666665,-7.5471698113207548 3.6226415094339623,-7.3200000000000003 3.7200000000000002,-3.473684210526315 3.0789473684210527,-3.2549019607843133 3.2156862745098036,-2.9999999999999982 3.1428571428571423,-3.1733333333333325 3.2666666666666666,-2.9180327868852456 3.4262295081967209,-2.8723404255319145 3.1063829787234041,-2.1111111111111112 2.8888888888888888,-2.1428571428571428 2.8571428571428572,-1.8433734939759043 2.8072289156626509,-1.8396226415094346 2.8113207547169816,-1.6486486486486487 2.756756756756757,-1.76510067114094 2.8926174496644301,-0.53846153846153855 4.2307692307692308,1.8148148148148147 5.4074074074074074,1.588235294117647 2.2352941176470589,1.819672131147541 2.1967213114754101,2 4,2 2.1666666666666665,2.3538461538461544 2.1076923076923078,2 1.6875000000000004,2 -2,1.2173913043478262 -3.8260869565217392,1.7375886524822697 1.3758865248226959,1.5073170731707317 1.1024390243902444,1.1428571428571428 -4,-0.59322033898305082 -8.0508474576271194),(1.666666666666667 1.5999999999999988,1.5675675675675675 1.8378378378378377,1.4374999999999991 1.8750000000000002,1.0487804878048776 2.3414634146341466,0.46666666666666712 2.6060606060606055,0.086956521739131043 2.2608695652173911,1.4374999999999991 1.8750000000000002,1.666666666666667 1.5999999999999988))", diff --git a/test/core/visit.cpp b/test/core/visit.cpp index 8cc85ef6e9..25e69103c3 100644 --- a/test/core/visit.cpp +++ b/test/core/visit.cpp @@ -58,76 +58,93 @@ void test_all() bg::traits::visit::apply([](auto g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const::value); + static_assert(! std::is_const::value, + "Copy of mutable must be visited as mutable."); }, dg); bg::traits::visit::apply([](auto const g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const::value); + static_assert(std::is_const::value, + "Const copy of mutable must be visited as const."); }, dg); bg::traits::visit::apply([](auto & g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); + static_assert(! std::is_const>::value, + "Reference of mutable must be visited as mutable."); }, dg); bg::traits::visit::apply([](auto const& g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); + static_assert(std::is_const>::value, + "Const reference of mutable must be visited as const."); }, dg); DynamicGeometry const cdg = point_t(3, 4); bg::traits::visit::apply([](auto g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const::value); + static_assert(! std::is_const::value, + "Copy of const must be visited as mutable."); }, cdg); bg::traits::visit::apply([](auto const g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const::value); + static_assert(std::is_const::value, + "Const copy of const must be visited as const."); }, cdg); bg::traits::visit::apply([](auto & g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); + static_assert(std::is_const>::value, + "Reference of const must be visited as const."); }, cdg); bg::traits::visit::apply([](auto const& g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); + static_assert(std::is_const>::value, + "Const reference of const must be visited as const."); }, cdg); - bg::traits::visit::apply([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Forward must remain mutable."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); }, dg); bg::traits::visit::apply([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); + static_assert(std::is_const>::value, + "Must remain const."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); }, cdg); bg::traits::visit::apply([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Moved from must remain mutable."); + static_assert(std::is_rvalue_reference::value, + "Moved from must dynamic geometry must be visited as rvalue reference."); }, std::move(dg)); bg::traits::visit::apply([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(std::is_const>::value, + "Moved from must remain const."); + static_assert(std::is_rvalue_reference::value, + "Moved from const dynamic geometry must be visited as rvalue reference."); }, std::move(cdg)); bg::traits::visit::apply([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Forwarded temporary dynamic geometry must be mutable."); + static_assert(std::is_rvalue_reference::value, + "Forwarded temporary dynamic geometry must be visited as rvalue reference."); }, DynamicGeometry{ point_t(1, 2) }); @@ -135,40 +152,56 @@ void test_all() { BOOST_CHECK(bg::util::is_point::value); BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Forward must remain mutable."); + static_assert(std::is_const>::value, + "Forward must remain const."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); }, dg, cdg); bg::traits::visit::apply([](auto && g1, auto && g2) { BOOST_CHECK(bg::util::is_point::value); BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Moved from must remain mutable."); + static_assert(std::is_const>::value, + "Moved from must remain const."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference."); }, std::move(dg), std::move(cdg)); bg::traits::visit::apply([](auto && g1, auto && g2) { BOOST_CHECK(bg::util::is_point::value); BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(!std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(!std::is_rvalue_reference::value); - BOOST_STATIC_ASSERT(!std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Forward must remain mutable."); + static_assert(std::is_const>::value, + "Forward must remain const."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); }, cdg, dg); bg::traits::visit::apply([](auto && g1, auto && g2) { BOOST_CHECK(bg::util::is_point::value); BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(!std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Moved from must remain mutable."); + static_assert(std::is_const>::value, + "Moved from must remain const."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference."); }, std::move(cdg), std::move(dg)); @@ -178,29 +211,37 @@ void test_all() bg::traits::iter_visit>::apply([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Forward must remain mutable."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); }, v.begin()); bg::traits::iter_visit>::apply([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(! std::is_rvalue_reference::value); + static_assert(std::is_const>::value, + "Forward must remain const."); + static_assert(! std::is_rvalue_reference::value, + "Forward must collapse to lvalue reference."); }, cv.begin()); bg::traits::iter_visit>::apply([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(! std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(! std::is_const>::value, + "Moved from must remain mutable."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as rvalue reference."); }, std::make_move_iterator(v.begin())); bg::traits::iter_visit>::apply([](auto && g) { BOOST_CHECK(bg::util::is_point::value); - BOOST_STATIC_ASSERT(std::is_const>::value); - BOOST_STATIC_ASSERT(std::is_rvalue_reference::value); + static_assert(std::is_const>::value, + "Moved from must remain const."); + static_assert(std::is_rvalue_reference::value, + "Moved from must be visited as lvalue reference."); }, std::make_move_iterator(cv.begin())); } diff --git a/test/io/wkt/wkt.cpp b/test/io/wkt/wkt.cpp index 24da7c8b8a..11858480a6 100644 --- a/test/io/wkt/wkt.cpp +++ b/test/io/wkt/wkt.cpp @@ -205,7 +205,7 @@ void test_wrong_wkt_read_write(std::string const& wkt, std::string const& start) // For ttmath we skip bad lexical casts typedef typename bg::coordinate_type::type ct; - if (boost::is_same::type::value + if (std::is_same::type::value && boost::starts_with(start, "bad lexical cast")) { check = false; diff --git a/test/strategies/pythagoras.cpp b/test/strategies/pythagoras.cpp index bfa4061609..99bb5bbf0b 100644 --- a/test/strategies/pythagoras.cpp +++ b/test/strategies/pythagoras.cpp @@ -17,6 +17,8 @@ // http://www.boost.org/LICENSE_1_0.txt) +#include + #include #if defined(_MSC_VER) @@ -266,10 +268,10 @@ void test_integer(bool check_types) if (check_types) { - BOOST_CHECK((boost::is_same::type::value)); + BOOST_CHECK((std::is_same::type::value)); // comparable_distance results in now double too, obviously because // comp.distance point-segment can be fraction, even for integer input - BOOST_CHECK((boost::is_same::type::value)); + BOOST_CHECK((std::is_same::type::value)); } } diff --git a/test/strategies/segment_intersection_sph.hpp b/test/strategies/segment_intersection_sph.hpp index b1830d1325..736a94e841 100644 --- a/test/strategies/segment_intersection_sph.hpp +++ b/test/strategies/segment_intersection_sph.hpp @@ -14,6 +14,8 @@ #define BOOST_GEOMETRY_TEST_STRATEGIES_SEGMENT_INTERSECTION_SPH_HPP +#include + #include #include @@ -97,7 +99,7 @@ void test_strategy_one(S1 const& s1, S2 const& s2, // probably due to differences in FP trigonometric function implementations int eps_scale = 1; - bool is_geographic = boost::is_same::type, bg::geographic_tag>::value; + bool is_geographic = std::is_same::type, bg::geographic_tag>::value; if (is_geographic) { eps_scale = 100000; diff --git a/test/util/compress_variant.cpp b/test/util/compress_variant.cpp index ab7a61ca9a..6965c2a969 100644 --- a/test/util/compress_variant.cpp +++ b/test/util/compress_variant.cpp @@ -13,12 +13,13 @@ // http://www.boost.org/LICENSE_1_0.txt) +#include + #include #include #include #include #include -#include #include @@ -43,7 +44,7 @@ template void test_single_type_result() { BOOST_MPL_ASSERT(( - boost::is_same< + std::is_same< typename boost::geometry::compress_variant::type, ExpectedType > diff --git a/test/util/is_implemented.cpp b/test/util/is_implemented.cpp index 869114b2fc..d18bb23599 100644 --- a/test/util/is_implemented.cpp +++ b/test/util/is_implemented.cpp @@ -23,7 +23,6 @@ #include -#include #include #include diff --git a/test/util/transform_variant.cpp b/test/util/transform_variant.cpp index 4594e591a3..cd84fffd6a 100644 --- a/test/util/transform_variant.cpp +++ b/test/util/transform_variant.cpp @@ -13,13 +13,14 @@ // http://www.boost.org/LICENSE_1_0.txt) +#include + #include #include #include #include #include #include -#include #include using boost::mpl::placeholders::_; @@ -42,7 +43,7 @@ int test_main(int, char* []) // Transform Variant to Variant typedef boost::geometry::transform_variant< boost::variant, - boost::add_pointer<_> + std::add_pointer<_> >::type transformed1; check >(transformed1()); @@ -50,7 +51,7 @@ int test_main(int, char* []) // Transform Sequence to Variant (without inserter) typedef boost::geometry::transform_variant< boost::mpl::vector, - boost::add_pointer<_> + std::add_pointer<_> >::type transformed2; check >(transformed2()); @@ -58,7 +59,7 @@ int test_main(int, char* []) // Transform Sequence to Variant (with inserter) typedef boost::geometry::transform_variant< boost::mpl::vector, - boost::add_pointer<_>, + std::add_pointer<_>, boost::mpl::back_inserter > >::type transformed3; diff --git a/test/views/random_access_view.cpp b/test/views/random_access_view.cpp index d847cbd181..36f4fcf119 100644 --- a/test/views/random_access_view.cpp +++ b/test/views/random_access_view.cpp @@ -85,9 +85,12 @@ void test_all(Make make) using non_gc_types = bg::util::type_sequence; using view_types = typename bg::traits::geometry_types::type; - BOOST_STATIC_ASSERT((std::is_same::value)); - BOOST_STATIC_ASSERT(bg::detail::is_random_access_range::value); - BOOST_STATIC_ASSERT(! bg::detail::is_geometry_collection_recursive::value); + static_assert(std::is_same::value, + "Unexpected type sequence returned."); + static_assert(bg::detail::is_random_access_range::value, + "Must satisfy random access range concept."); + static_assert(! bg::detail::is_geometry_collection_recursive::value, + "Must not be nested geometry collection."); size_t s = boost::size(gc); for (size_t i = 0 ; i < s ; ++i) @@ -104,15 +107,23 @@ void test_all(Make make) int test_main(int, char* []) { - BOOST_STATIC_ASSERT(bg::detail::is_random_access_range::value); - BOOST_STATIC_ASSERT(! bg::detail::is_random_access_range::value); - BOOST_STATIC_ASSERT(bg::detail::is_random_access_range::value); - BOOST_STATIC_ASSERT(! bg::detail::is_random_access_range::value); - - BOOST_STATIC_ASSERT(! bg::detail::is_geometry_collection_recursive::value); - BOOST_STATIC_ASSERT(! bg::detail::is_geometry_collection_recursive::value); - BOOST_STATIC_ASSERT(bg::detail::is_geometry_collection_recursive::value); - BOOST_STATIC_ASSERT(bg::detail::is_geometry_collection_recursive::value); + static_assert(bg::detail::is_random_access_range::value, + "Default geometry collection must satisfy random access range concept."); + static_assert(! bg::detail::is_random_access_range::value, + "List-based geometry collection must not satisfy random access range concept."); + static_assert(bg::detail::is_random_access_range::value, + "Default geometry collection must satisfy random access range concept."); + static_assert(! bg::detail::is_random_access_range::value, + "List-based geometry collection must not satisfy random access range concept."); + + static_assert(! bg::detail::is_geometry_collection_recursive::value, + "Flat GC must not satisfy recursive GC predicate."); + static_assert(! bg::detail::is_geometry_collection_recursive::value, + "Flat GC must not satisfy recursive GC predicate."); + static_assert(bg::detail::is_geometry_collection_recursive::value, + "Recursive GC must satisfy recursive GC predicate."); + static_assert(bg::detail::is_geometry_collection_recursive::value, + "Recursive GC must satisfy recursive GC predicate."); test_all(make_gc); test_all(make_gc);