]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/geometry/algorithms/clear.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / geometry / algorithms / clear.hpp
index 05c910f2e2cc206bf0e9d1f1691f91459aff5b6b..26d60c57f23873328e6a68e0c8ee0f1ba1bbc177 100644 (file)
@@ -4,8 +4,8 @@
 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
 
-// This file was modified by Oracle on 2020.
-// Modifications copyright (c) 2020, Oracle and/or its affiliates.
+// This file was modified by Oracle on 2020-2021.
+// Modifications copyright (c) 2020-2021, Oracle and/or its affiliates.
 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
 
 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
 
 #include <type_traits>
 
-#include <boost/variant/apply_visitor.hpp>
-#include <boost/variant/static_visitor.hpp>
-#include <boost/variant/variant_fwd.hpp>
-
 #include <boost/geometry/algorithms/not_implemented.hpp>
 #include <boost/geometry/core/access.hpp>
 #include <boost/geometry/core/exterior_ring.hpp>
@@ -32,6 +28,8 @@
 #include <boost/geometry/core/mutable_range.hpp>
 #include <boost/geometry/core/tag_cast.hpp>
 #include <boost/geometry/core/tags.hpp>
+#include <boost/geometry/core/visit.hpp>
+#include <boost/geometry/geometries/adapted/boost_variant.hpp> // for backward compatibility
 #include <boost/geometry/geometries/concepts/check.hpp>
 
 
@@ -137,40 +135,31 @@ struct clear<Geometry, multi_tag>
 {};
 
 
-} // namespace dispatch
-#endif // DOXYGEN_NO_DISPATCH
-
-
-namespace resolve_variant {
-
 template <typename Geometry>
-struct clear
+struct clear<Geometry, dynamic_geometry_tag>
 {
-    static inline void apply(Geometry& geometry)
+    static void apply(Geometry& geometry)
     {
-        dispatch::clear<Geometry>::apply(geometry);
+        traits::visit<Geometry>::apply([](auto & g)
+        {
+            clear<std::remove_reference_t<decltype(g)>>::apply(g);
+        }, geometry);
     }
 };
 
-template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
-struct clear<variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
-{
-    struct visitor: static_visitor<void>
-    {
-        template <typename Geometry>
-        inline void operator()(Geometry& geometry) const
-        {
-            clear<Geometry>::apply(geometry);
-        }
-    };
 
-    static inline void apply(variant<BOOST_VARIANT_ENUM_PARAMS(T)>& geometry)
+template <typename Geometry>
+struct clear<Geometry, geometry_collection_tag>
+{
+    static void apply(Geometry& geometry)
     {
-        boost::apply_visitor(visitor(), geometry);
+        traits::clear<Geometry>::apply(geometry);
     }
 };
 
-} // namespace resolve_variant
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
 
 
 /*!
@@ -191,7 +180,7 @@ inline void clear(Geometry& geometry)
 {
     concepts::check<Geometry>();
 
-    resolve_variant::clear<Geometry>::apply(geometry);
+    dispatch::clear<Geometry>::apply(geometry);
 }