]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/algorithms/envelope_expand/test_envelope.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / geometry / test / algorithms / envelope_expand / test_envelope.hpp
index c0dc916394e5e74ba3cdbbd7575f9a1db0bf6b01..0873d81ba5b427172ddd0e9b8db11b6fdf608cff 100644 (file)
@@ -2,6 +2,11 @@
 // Unit Test
 
 // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
+
+// This file was modified by Oracle on 2021.
+// Modifications copyright (c) 2021, Oracle and/or its affiliates.
+// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
+
 // Use, modification and distribution is subject to the Boost Software License,
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
@@ -16,6 +21,7 @@
 
 #include <boost/geometry/algorithms/envelope.hpp>
 #include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/geometry_collection.hpp>
 #include <boost/geometry/strategies/strategies.hpp>
 
 #include <boost/geometry/io/wkt/read.hpp>
@@ -28,13 +34,13 @@ struct check_result
 template <typename Box>
 struct check_result<Box, 2>
 {
-    typedef typename bg::coordinate_type<Box>::type ctype;
-    typedef typename boost::mpl::if_
-            <
-                boost::is_arithmetic<ctype>,
-                double,
-                ctype
-            >::type type;
+    using ctype = typename bg::coordinate_type<Box>::type;
+    using type = std::conditional_t
+        <
+            (std::is_integral<ctype>::value || std::is_floating_point<ctype>::value),
+            double,
+            ctype
+        >;
 
     static void apply(Box const& b, const type& x1, const type& y1, const type& /*z1*/,
                 const type& x2, const type& y2, const type& /*z2*/)
@@ -50,13 +56,13 @@ struct check_result<Box, 2>
 template <typename Box>
 struct check_result<Box, 3>
 {
-    typedef typename bg::coordinate_type<Box>::type ctype;
-    typedef typename boost::mpl::if_
-            <
-                boost::is_arithmetic<ctype>,
-                double,
-                ctype
-            >::type type;
+    using ctype = typename bg::coordinate_type<Box>::type;
+    using type = std::conditional_t
+        <
+            (std::is_integral<ctype>::value || std::is_floating_point<ctype>::value),
+            double,
+            ctype
+        >;
 
     static void apply(Box const& b, const type& x1, const type& y1, const type& z1,
                 const type& x2, const type& y2, const type& z2)
@@ -92,6 +98,10 @@ void test_envelope(std::string const& wkt,
     check_result<box_type, bg::dimension<Geometry>::type::value>
             ::apply(b, x1, y1, z1, x2, y2, z2);
 
+    bg::model::geometry_collection<boost::variant<Geometry>> gc{v};
+    bg::envelope(gc, b);
+    check_result<box_type, bg::dimension<Geometry>::type::value>
+            ::apply(b, x1, y1, z1, x2, y2, z2);
 }