]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/geometry/test/policies/rescale_policy.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / geometry / test / policies / rescale_policy.cpp
index c91f31988d8f97fe43a69d9f02bb5d2f9ef33a2a..17c3e99e1b75f9f34d5233d0a534e5facdd30e42 100644 (file)
@@ -5,6 +5,10 @@
 // Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
 // Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
 
+// 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
+
 // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
 // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
 
 #include <iostream>
 #include <string>
 
-#include <boost/foreach.hpp>
-
 #include <boost/geometry/algorithms/correct.hpp>
 #include <boost/geometry/algorithms/detail/recalculate.hpp>
 #include <boost/geometry/algorithms/length.hpp>
 #include <boost/geometry/algorithms/num_points.hpp>
-#include <boost/geometry/geometries/geometries.hpp>
-#include <boost/geometry/geometries/point_xy.hpp>
-#include <boost/geometry/strategies/strategies.hpp>
+#include <boost/geometry/io/wkt/wkt.hpp>
 #include <boost/geometry/iterators/point_iterator.hpp>
+#include <boost/geometry/geometries/geometries.hpp>
 #include <boost/geometry/policies/robustness/get_rescale_policy.hpp>
-
-#include <boost/geometry/io/wkt/wkt.hpp>
-
-
+#include <boost/geometry/strategies/strategies.hpp>
 
 #include <geometry_test_common.hpp>
 
@@ -94,14 +92,14 @@ static std::string simplex_large[2] =
 template <bool Rescale, typename P>
 void test_rescale(std::string const& expected_normal, std::string const& expected_large)
 {
-    typedef bg::model::polygon<P> polygon;
+    using polygon = bg::model::polygon<P>;
 
-    typedef typename boost::mpl::if_c
+    using rescale_policy_type = std::conditional_t
         <
             Rescale,
-            typename bg::rescale_policy_type<P>::type ,
+            typename bg::rescale_policy_type<P>::type,
             bg::detail::no_rescale_policy
-        >::type rescale_policy_type;
+        >;
 
     test_one<rescale_policy_type, polygon, polygon>(
         simplex_normal[0], simplex_normal[1],
@@ -122,12 +120,13 @@ void test_all(std::string const& expected_normal, std::string const& expected_la
 
 int test_main(int, char* [])
 {
+#if defined(BOOST_GEOMETRY_USE_RESCALING)
     test_all<double>("-5000000 -3000000", "-5000000 -3000000");
     test_all<long double>("-5000000 -3000000", "-5000000 -3000000");
     test_all<int>("0 1", "0 1000");
-    test_all<boost::long_long_type>("0 1", "0 1000");
+    test_all<long long>("0 1", "0 1000");
     //    test_all<short int>(); // compiles but overflows
-
+#endif
     return 0;
 }