// 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)
#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>
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*/)
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)
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);
}