diff options
Diffstat (limited to 'boost/geometry/algorithms/assign.hpp')
-rw-r--r-- | boost/geometry/algorithms/assign.hpp | 60 |
1 files changed, 25 insertions, 35 deletions
diff --git a/boost/geometry/algorithms/assign.hpp b/boost/geometry/algorithms/assign.hpp index 8ab4745d2e..dabf1b4a57 100644 --- a/boost/geometry/algorithms/assign.hpp +++ b/boost/geometry/algorithms/assign.hpp @@ -5,8 +5,9 @@ // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. // Copyright (c) 2014 Samuel Debionne, Grenoble, France. -// This file was modified by Oracle on 2020-2021. -// Modifications copyright (c) 2020-2021 Oracle and/or its affiliates. +// This file was modified by Oracle on 2020-2023. +// Modifications copyright (c) 2020-2023 Oracle and/or its affiliates. +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library @@ -19,29 +20,18 @@ #ifndef BOOST_GEOMETRY_ALGORITHMS_ASSIGN_HPP #define BOOST_GEOMETRY_ALGORITHMS_ASSIGN_HPP - -#include <cstddef> - -#include <boost/concept/requires.hpp> -#include <boost/concept_check.hpp> -#include <boost/numeric/conversion/bounds.hpp> -#include <boost/numeric/conversion/cast.hpp> - -#include <boost/variant/apply_visitor.hpp> #include <boost/variant/static_visitor.hpp> #include <boost/variant/variant_fwd.hpp> +#include <boost/geometry/algorithms/append.hpp> +#include <boost/geometry/algorithms/clear.hpp> +#include <boost/geometry/algorithms/convert.hpp> + #include <boost/geometry/algorithms/detail/assign_box_corners.hpp> #include <boost/geometry/algorithms/detail/assign_indexed_point.hpp> #include <boost/geometry/algorithms/detail/assign_values.hpp> -#include <boost/geometry/algorithms/convert.hpp> -#include <boost/geometry/algorithms/append.hpp> -#include <boost/geometry/algorithms/clear.hpp> -#include <boost/geometry/arithmetic/arithmetic.hpp> -#include <boost/geometry/core/access.hpp> -#include <boost/geometry/core/exterior_ring.hpp> + #include <boost/geometry/core/static_assert.hpp> -#include <boost/geometry/core/tags.hpp> #include <boost/geometry/geometries/concepts/check.hpp> @@ -231,7 +221,7 @@ struct assign concepts::check<Geometry1>(); concepts::check<Geometry2 const>(); concepts::check_concepts_and_equal_dimensions<Geometry1, Geometry2 const>(); - + static bool const same_point_order = point_order<Geometry1>::value == point_order<Geometry2>::value; BOOST_GEOMETRY_STATIC_ASSERT( @@ -244,23 +234,23 @@ struct assign same_closure, "Assign is not supported for different closures.", Geometry1, Geometry2); - + dispatch::convert<Geometry2, Geometry1>::apply(geometry2, geometry1); } }; - - + + template <BOOST_VARIANT_ENUM_PARAMS(typename T), typename Geometry2> struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Geometry2> { struct visitor: static_visitor<void> { Geometry2 const& m_geometry2; - + visitor(Geometry2 const& geometry2) : m_geometry2(geometry2) {} - + template <typename Geometry1> result_type operator()(Geometry1& geometry1) const { @@ -272,7 +262,7 @@ struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Geometry2> (geometry1, m_geometry2); } }; - + static inline void apply(variant<BOOST_VARIANT_ENUM_PARAMS(T)>& geometry1, Geometry2 const& geometry2) @@ -280,19 +270,19 @@ struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T)>, Geometry2> return boost::apply_visitor(visitor(geometry2), geometry1); } }; - - + + template <typename Geometry1, BOOST_VARIANT_ENUM_PARAMS(typename T)> struct assign<Geometry1, variant<BOOST_VARIANT_ENUM_PARAMS(T)> > { struct visitor: static_visitor<void> { Geometry1& m_geometry1; - + visitor(Geometry1 const& geometry1) : m_geometry1(geometry1) {} - + template <typename Geometry2> result_type operator()(Geometry2 const& geometry2) const { @@ -304,7 +294,7 @@ struct assign<Geometry1, variant<BOOST_VARIANT_ENUM_PARAMS(T)> > (m_geometry1, geometry2); } }; - + static inline void apply(Geometry1& geometry1, variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& geometry2) @@ -312,8 +302,8 @@ struct assign<Geometry1, variant<BOOST_VARIANT_ENUM_PARAMS(T)> > return boost::apply_visitor(visitor(geometry1), geometry2); } }; - - + + template <BOOST_VARIANT_ENUM_PARAMS(typename T1), BOOST_VARIANT_ENUM_PARAMS(typename T2)> struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T1)>, variant<BOOST_VARIANT_ENUM_PARAMS(T2)> > { @@ -332,7 +322,7 @@ struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T1)>, variant<BOOST_VARIANT_ENUM (geometry1, geometry2); } }; - + static inline void apply(variant<BOOST_VARIANT_ENUM_PARAMS(T1)>& geometry1, variant<BOOST_VARIANT_ENUM_PARAMS(T2)> const& geometry2) @@ -340,9 +330,9 @@ struct assign<variant<BOOST_VARIANT_ENUM_PARAMS(T1)>, variant<BOOST_VARIANT_ENUM return boost::apply_visitor(visitor(), geometry1, geometry2); } }; - + } // namespace resolve_variant - + /*! \brief Assigns one geometry to another geometry |