update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -0,0 +1,75 @@
// Boost.Geometry
// Copyright (c) 2021, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ANY_HPP
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ANY_HPP
#include <utility>
#include <boost/any.hpp>
#include <boost/geometry/geometries/adapted/detail/any.hpp>
#include <boost/geometry/core/geometry_types.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/core/visit.hpp>
namespace boost { namespace geometry
{
namespace detail
{
struct boost_any_cast_policy
{
template <typename T, typename Any>
static inline T * apply(Any * any_ptr)
{
return boost::any_cast<T>(any_ptr);
}
};
} // namespace detail
namespace traits
{
template <>
struct tag<boost::any>
{
using type = dynamic_geometry_tag;
};
template <>
struct visit<boost::any>
{
template <typename Function, typename Any>
static void apply(Function && function, Any && any)
{
using types_t = typename geometry_types<util::remove_cref_t<Any>>::type;
geometry::detail::visit_any
<
geometry::detail::boost_any_cast_policy, types_t
>::template apply<0>(std::forward<Function>(function), std::forward<Any>(any));
}
};
} // namespace traits
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_ANY_HPP

View File

@@ -3,6 +3,10 @@
// Copyright (c) 2010 Alfredo Correa
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020 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)
@@ -21,8 +25,7 @@
#include <cstddef>
#include <boost/type_traits/is_arithmetic.hpp>
#include <type_traits>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/cs.hpp>
@@ -69,7 +72,7 @@ struct boost_array_tag<true>
// Assign the point-tag, preventing arrays of points getting a point-tag
template <typename CoordinateType, std::size_t DimensionCount>
struct tag<boost::array<CoordinateType, DimensionCount> >
: detail::boost_array_tag<boost::is_arithmetic<CoordinateType>::value> {};
: detail::boost_array_tag<std::is_arithmetic<CoordinateType>::value> {};
template <typename CoordinateType, std::size_t DimensionCount>
@@ -80,7 +83,9 @@ struct coordinate_type<boost::array<CoordinateType, DimensionCount> >
template <typename CoordinateType, std::size_t DimensionCount>
struct dimension<boost::array<CoordinateType, DimensionCount> >: boost::mpl::int_<DimensionCount> {};
struct dimension<boost::array<CoordinateType, DimensionCount> >
: std::integral_constant<std::size_t, DimensionCount>
{};
template <typename CoordinateType, std::size_t DimensionCount, std::size_t Dimension>

View File

@@ -3,10 +3,11 @@
// Copyright (c) 2011-2015 Akira Takahashi
// Copyright (c) 2011-2015 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2015.
// Modifications copyright (c) 2015, Oracle and/or its affiliates.
// This file was modified by Oracle on 2015-2020.
// Modifications copyright (c) 2015-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
// 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
@@ -17,8 +18,7 @@
#include <cstddef>
#include <boost/core/enable_if.hpp>
#include <type_traits>
#include <boost/fusion/include/is_sequence.hpp>
#include <boost/fusion/include/size.hpp>
@@ -35,7 +35,6 @@
#include <boost/mpl/size.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/coordinate_dimension.hpp>
@@ -53,27 +52,46 @@ namespace fusion_adapt_detail
template <class Sequence>
struct all_same :
boost::mpl::bool_<
boost::mpl::count_if<
Sequence,
boost::is_same<
typename boost::mpl::front<Sequence>::type,
boost::mpl::_
>
>::value == boost::mpl::size<Sequence>::value
>
std::integral_constant
<
bool,
boost::mpl::count_if<
Sequence,
boost::is_same<
typename boost::mpl::front<Sequence>::type,
boost::mpl::_
>
>::value == boost::mpl::size<Sequence>::value
>
{};
template <class Sequence>
struct is_coordinate_size : boost::mpl::bool_<
boost::fusion::result_of::size<Sequence>::value == 2 ||
boost::fusion::result_of::size<Sequence>::value == 3> {};
struct is_coordinate_size
: std::integral_constant
<
bool,
(boost::fusion::result_of::size<Sequence>::value == 2
|| boost::fusion::result_of::size<Sequence>::value == 3)
>
{};
template
<
typename Sequence,
bool IsSequence = boost::fusion::traits::is_sequence<Sequence>::value
>
struct is_fusion_sequence
: std::integral_constant
<
bool,
(fusion_adapt_detail::is_coordinate_size<Sequence>::value
&& fusion_adapt_detail::all_same<Sequence>::value)
>
{};
template<typename Sequence>
struct is_fusion_sequence
: boost::mpl::and_<boost::fusion::traits::is_sequence<Sequence>,
fusion_adapt_detail::is_coordinate_size<Sequence>,
fusion_adapt_detail::all_same<Sequence> >
struct is_fusion_sequence<Sequence, false>
: std::false_type
{};
@@ -89,10 +107,10 @@ template <typename Sequence>
struct coordinate_type
<
Sequence,
typename boost::enable_if
std::enable_if_t
<
fusion_adapt_detail::is_fusion_sequence<Sequence>
>::type
fusion_adapt_detail::is_fusion_sequence<Sequence>::value
>
>
{
typedef typename boost::mpl::front<Sequence>::type type;
@@ -103,10 +121,10 @@ template <typename Sequence>
struct dimension
<
Sequence,
typename boost::enable_if
std::enable_if_t
<
fusion_adapt_detail::is_fusion_sequence<Sequence>
>::type
fusion_adapt_detail::is_fusion_sequence<Sequence>::value
>
> : boost::mpl::size<Sequence>
{};
@@ -116,10 +134,10 @@ struct access
<
Sequence,
Dimension,
typename boost::enable_if
std::enable_if_t
<
fusion_adapt_detail::is_fusion_sequence<Sequence>
>::type
fusion_adapt_detail::is_fusion_sequence<Sequence>::value
>
>
{
typedef typename coordinate_type<Sequence>::type ctype;
@@ -141,10 +159,10 @@ template <typename Sequence>
struct tag
<
Sequence,
typename boost::enable_if
std::enable_if_t
<
fusion_adapt_detail::is_fusion_sequence<Sequence>
>::type
fusion_adapt_detail::is_fusion_sequence<Sequence>::value
>
>
{
typedef point_tag type;
@@ -166,10 +184,10 @@ struct tag
struct coordinate_system \
< \
Sequence, \
typename boost::enable_if \
std::enable_if_t \
< \
fusion_adapt_detail::is_fusion_sequence<Sequence> \
>::type \
fusion_adapt_detail::is_fusion_sequence<Sequence>::value \
> \
> \
{ typedef CoordinateSystem type; }; \
}}}

View File

@@ -2,6 +2,10 @@
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, 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)
@@ -33,12 +37,12 @@ struct holes_proxy
{
typedef ring_proxy
<
typename boost::mpl::if_
std::conditional_t
<
typename boost::is_const<Polygon>,
std::is_const<Polygon>::value,
Polygon const,
Polygon
>::type
>
> proxy_type;
typedef hole_iterator<Polygon, proxy_type> iterator_type;

View File

@@ -2,6 +2,10 @@
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, 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)
@@ -13,6 +17,8 @@
// boost::polygon::point_data -> boost::geometry::point
#include <type_traits>
#include <boost/polygon/polygon.hpp>
#include <boost/geometry/core/access.hpp>
@@ -54,7 +60,7 @@ struct coordinate_system<boost::polygon::point_data<CoordinateType> >
template <typename CoordinateType>
struct dimension<boost::polygon::point_data<CoordinateType> >
: boost::mpl::int_<2>
: std::integral_constant<std::size_t, 2>
{};

View File

@@ -4,8 +4,8 @@
// Copyright (c) 2008-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2018.
// Modifications copyright (c) 2018, Oracle and/or its affiliates.
// This file was modified by Oracle on 2018-2020.
// Modifications copyright (c) 2018-2020, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
@@ -21,6 +21,7 @@
#include <cstddef>
#include <type_traits>
#include <boost/tuple/tuple.hpp>
@@ -59,13 +60,14 @@ struct coordinate_type<boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >
template <typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
struct dimension<boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> >
: boost::mpl::int_
<
boost::tuples::length
<
boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
>::value
>
: std::integral_constant
<
std::size_t,
boost::tuples::length
<
boost::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
>::value
>
{};

View File

@@ -0,0 +1,175 @@
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2008-2012 Bruno Lalande, Paris, France.
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2009-2012 Mateusz Loskot, London, UK.
// This file was modified by Oracle on 2018-2021.
// Modifications copyright (c) 2018-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.
// 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)
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_VARIANT_HPP
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_VARIANT_HPP
#include <boost/variant/apply_visitor.hpp>
#include <boost/variant/static_visitor.hpp>
#include <boost/variant/variant.hpp>
//#include <boost/variant/variant_fwd.hpp>
#include <boost/geometry/core/geometry_types.hpp>
#include <boost/geometry/core/point_type.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/core/visit.hpp>
#include <boost/geometry/util/sequence.hpp>
namespace boost { namespace geometry
{
namespace detail
{
template <typename Seq, typename ResultSeq = util::type_sequence<>>
struct boost_variant_types;
template <typename T, typename ...Ts, typename ...Rs>
struct boost_variant_types<util::type_sequence<T, Ts...>, util::type_sequence<Rs...>>
{
using type = typename boost_variant_types<util::type_sequence<Ts...>, util::type_sequence<Rs..., T>>::type;
};
template <typename ...Ts, typename ...Rs>
struct boost_variant_types<util::type_sequence<boost::detail::variant::void_, Ts...>, util::type_sequence<Rs...>>
{
using type = util::type_sequence<Rs...>;
};
template <typename ...Rs>
struct boost_variant_types<util::type_sequence<>, util::type_sequence<Rs...>>
{
using type = util::type_sequence<Rs...>;
};
} // namespace detail
// TODO: This is not used anywhere in the header files. Only in tests.
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
struct point_type<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
: point_type
<
typename util::pack_front
<
BOOST_VARIANT_ENUM_PARAMS(T)
>::type
>
{};
namespace traits
{
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
struct tag<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>>
{
using type = dynamic_geometry_tag;
};
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
struct visit<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>>
{
template <typename Function>
struct visitor
: boost::static_visitor<>
{
visitor(Function function)
: m_function(function)
{}
template <typename Geometry>
void operator()(Geometry && geometry)
{
m_function(std::forward<Geometry>(geometry));
}
Function m_function;
};
template <typename Function, typename Variant>
static void apply(Function function, Variant && variant)
{
visitor<Function> visitor(function);
boost::apply_visitor(visitor, std::forward<Variant>(variant));
}
};
template <BOOST_VARIANT_ENUM_PARAMS(typename T), BOOST_VARIANT_ENUM_PARAMS(typename U)>
struct visit<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>, boost::variant<BOOST_VARIANT_ENUM_PARAMS(U)>>
{
template <typename Function>
struct visitor
: boost::static_visitor<>
{
visitor(Function function)
: m_function(function)
{}
template <typename Geometry1, typename Geometry2>
void operator()(Geometry1 && geometry1, Geometry2 && geometry2)
{
m_function(std::forward<Geometry1>(geometry1),
std::forward<Geometry2>(geometry2));
}
Function m_function;
};
template <typename Function, typename Variant1, typename Variant2>
static void apply(Function function, Variant1 && variant1, Variant2 && variant2)
{
visitor<Function> visitor(function);
boost::apply_visitor(visitor,
std::forward<Variant1>(variant1),
std::forward<Variant2>(variant2));
}
};
#ifdef BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
struct geometry_types<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>>
{
using type = typename geometry::detail::boost_variant_types
<
util::type_sequence<BOOST_VARIANT_ENUM_PARAMS(T)>
>::type;
};
#else // BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES
template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
struct geometry_types<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>>
{
using type = util::type_sequence<BOOST_VARIANT_ENUM_PARAMS(T)>;
};
#endif // BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES
} // namespace traits
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_VARIANT_HPP

View File

@@ -0,0 +1,73 @@
// Boost.Geometry
// Copyright (c) 2021, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_VARIANT2_HPP
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_VARIANT2_HPP
#include <utility>
#include <boost/variant2/variant.hpp>
#include <boost/geometry/core/geometry_types.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/core/visit.hpp>
#include <boost/geometry/util/sequence.hpp>
namespace boost { namespace geometry
{
namespace traits
{
template <typename ...Ts>
struct tag<boost::variant2::variant<Ts...>>
{
using type = dynamic_geometry_tag;
};
template <typename ...Ts>
struct visit<boost::variant2::variant<Ts...>>
{
template <typename Function, typename Variant>
static void apply(Function && function, Variant && variant)
{
boost::variant2::visit(std::forward<Function>(function),
std::forward<Variant>(variant));
}
};
template <typename ...Ts, typename ...Us>
struct visit<boost::variant2::variant<Ts...>, boost::variant2::variant<Us...>>
{
template <typename Function, typename Variant1, typename Variant2>
static void apply(Function && function, Variant1 && variant1, Variant2 && variant2)
{
boost::variant2::visit(std::forward<Function>(function),
std::forward<Variant1>(variant1),
std::forward<Variant2>(variant2));
}
};
template <typename ...Ts>
struct geometry_types<boost::variant2::variant<Ts...>>
{
using type = util::type_sequence<Ts...>;
};
} // namespace traits
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_VARIANT2_HPP

View File

@@ -4,6 +4,10 @@
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// 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.
// 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.
@@ -15,8 +19,7 @@
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_C_ARRAY_HPP
#include <cstddef>
#include <boost/type_traits/is_arithmetic.hpp>
#include <type_traits>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/cs.hpp>
@@ -61,7 +64,7 @@ struct c_array_tag<true>
// Assign the point-tag, preventing arrays of points getting a point-tag
template <typename CoordinateType, std::size_t DimensionCount>
struct tag<CoordinateType[DimensionCount]>
: detail::c_array_tag<boost::is_arithmetic<CoordinateType>::value> {};
: detail::c_array_tag<std::is_arithmetic<CoordinateType>::value> {};
template <typename CoordinateType, std::size_t DimensionCount>
@@ -72,7 +75,9 @@ struct coordinate_type<CoordinateType[DimensionCount]>
template <typename CoordinateType, std::size_t DimensionCount>
struct dimension<CoordinateType[DimensionCount]>: boost::mpl::int_<DimensionCount> {};
struct dimension<CoordinateType[DimensionCount]>
: std::integral_constant<std::size_t, DimensionCount>
{};
template <typename CoordinateType, std::size_t DimensionCount, std::size_t Dimension>

View File

@@ -0,0 +1,87 @@
// Boost.Geometry
// Copyright (c) 2021, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_DETAIL_ANY_HPP
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_DETAIL_ANY_HPP
#include <utility>
#include <boost/geometry/util/sequence.hpp>
#include <boost/geometry/util/type_traits_std.hpp>
namespace boost { namespace geometry
{
namespace detail
{
template
<
typename CastPolicy,
typename TypeSequence,
std::size_t N = util::sequence_size<TypeSequence>::value
>
struct visit_any
{
static const std::size_t M = N / 2;
template <std::size_t Offset, typename Function, typename Any>
static bool apply(Function && function, Any && any)
{
return visit_any<CastPolicy, TypeSequence, M>::template apply<Offset>(
std::forward<Function>(function), std::forward<Any>(any))
|| visit_any<CastPolicy, TypeSequence, N - M>::template apply<Offset + M>(
std::forward<Function>(function), std::forward<Any>(any));
}
};
template <typename CastPolicy, typename TypeSequence>
struct visit_any<CastPolicy, TypeSequence, 1>
{
template <std::size_t Offset, typename Function, typename Any>
static bool apply(Function && function, Any && any)
{
using elem_t = typename util::sequence_element<Offset, TypeSequence>::type;
using geom_t = util::transcribe_const_t<std::remove_reference_t<Any>, elem_t>;
geom_t * g = CastPolicy::template apply<geom_t>(&any);
if (g != nullptr)
{
using geom_ref_t = std::conditional_t
<
std::is_rvalue_reference<decltype(any)>::value,
geom_t&&, geom_t&
>;
function(static_cast<geom_ref_t>(*g));
return true;
}
else
{
return false;
}
}
};
template <typename CastPolicy, typename TypeSequence>
struct visit_any<CastPolicy, TypeSequence, 0>
{
template <std::size_t Offset, typename Function, typename Any>
static bool apply(Function &&, Any &&)
{
return false;
}
};
} // namespace detail
}} // namespace boost::geometry
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_DETAIL_ANY_HPP

View File

@@ -0,0 +1,82 @@
// Boost.Geometry
// Copyright (c) 2021, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_ANY_HPP
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_ANY_HPP
#include <boost/config.hpp>
#ifndef BOOST_NO_CXX17_HDR_ANY
#include <any>
#include <utility>
#include <boost/geometry/geometries/adapted/detail/any.hpp>
#include <boost/geometry/core/geometry_types.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/core/visit.hpp>
namespace boost { namespace geometry
{
namespace detail
{
struct std_any_cast_policy
{
template <typename T, typename Any>
static inline T * apply(Any * any_ptr)
{
return std::any_cast<T>(any_ptr);
}
};
} // namespace detail
namespace traits
{
template <>
struct tag<std::any>
{
using type = dynamic_geometry_tag;
};
template <>
struct visit<std::any>
{
template <typename Function, typename Any>
static void apply(Function && function, Any && any)
{
using types_t = typename geometry_types<util::remove_cref_t<Any>>::type;
geometry::detail::visit_any
<
geometry::detail::std_any_cast_policy, types_t
>::template apply<0>(std::forward<Function>(function), std::forward<Any>(any));
}
};
} // namespace traits
}} // namespace boost::geometry
#endif // BOOST_NO_CXX17_HDR_ANY
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_ANY_HPP

View File

@@ -4,6 +4,10 @@
// Copyright (c) 2010-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Copyright (c) 2016 Norbert Wenzel
// This file was modified by Oracle on 2020.
// Modifications copyright (c) 2020, 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)
@@ -14,16 +18,12 @@
#include <boost/config.hpp>
#ifndef BOOST_NO_CXX11_HDR_ARRAY
#define BOOST_GEOMETRY_ADAPTED_STD_ARRAY_TAG_DEFINED
#include <array>
#include <cstddef>
#include <boost/type_traits/is_arithmetic.hpp>
#include <type_traits>
#include <boost/geometry/core/access.hpp>
#include <boost/geometry/core/cs.hpp>
@@ -31,7 +31,6 @@
#include <boost/geometry/core/coordinate_type.hpp>
#include <boost/geometry/core/tags.hpp>
#include <array>
namespace boost { namespace geometry
{
@@ -70,7 +69,7 @@ struct std_array_tag<true>
// Assign the point-tag, preventing arrays of points getting a point-tag
template <typename CoordinateType, std::size_t DimensionCount>
struct tag<std::array<CoordinateType, DimensionCount> >
: detail::std_array_tag<boost::is_arithmetic<CoordinateType>::value> {};
: detail::std_array_tag<std::is_arithmetic<CoordinateType>::value> {};
template <typename CoordinateType, std::size_t DimensionCount>
@@ -81,7 +80,9 @@ struct coordinate_type<std::array<CoordinateType, DimensionCount> >
template <typename CoordinateType, std::size_t DimensionCount>
struct dimension<std::array<CoordinateType, DimensionCount> >: boost::mpl::int_<DimensionCount> {};
struct dimension<std::array<CoordinateType, DimensionCount> >
: std::integral_constant<std::size_t, DimensionCount>
{};
template <typename CoordinateType, std::size_t DimensionCount, std::size_t Dimension>
@@ -116,15 +117,5 @@ struct access<std::array<CoordinateType, DimensionCount>, Dimension>
}; \
}}}
#else
#warning "This file requires compiler and library support for the ISO C++ 2011 standard."
#endif // BOOST_NO_CXX11_HDR_ARRAY
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_ARRAY_HPP

View File

@@ -0,0 +1,80 @@
// Boost.Geometry
// Copyright (c) 2021, Oracle and/or its affiliates.
// Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
// Licensed under the Boost Software License version 1.0.
// http://www.boost.org/users/license.html
#ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_VARIANT_HPP
#define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_VARIANT_HPP
#include <boost/config.hpp>
#ifndef BOOST_NO_CXX17_HDR_VARIANT
#include <utility>
#include <variant>
#include <boost/geometry/core/geometry_types.hpp>
#include <boost/geometry/core/tag.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/core/visit.hpp>
#include <boost/geometry/util/sequence.hpp>
namespace boost { namespace geometry
{
namespace traits
{
template <typename ...Ts>
struct tag<std::variant<Ts...>>
{
using type = dynamic_geometry_tag;
};
template <typename ...Ts>
struct visit<std::variant<Ts...>>
{
template <typename Function, typename Variant>
static void apply(Function && function, Variant && variant)
{
std::visit(std::forward<Function>(function),
std::forward<Variant>(variant));
}
};
template <typename ...Ts, typename ...Us>
struct visit<std::variant<Ts...>, std::variant<Us...>>
{
template <typename Function, typename Variant1, typename Variant2>
static void apply(Function && function, Variant1 && variant1, Variant2 && variant2)
{
std::visit(std::forward<Function>(function),
std::forward<Variant1>(variant1),
std::forward<Variant2>(variant2));
}
};
template <typename ...Ts>
struct geometry_types<std::variant<Ts...>>
{
using type = util::type_sequence<Ts...>;
};
} // namespace traits
}} // namespace boost::geometry
#endif // BOOST_NO_CXX17_HDR_VARIANT
#endif // BOOST_GEOMETRY_GEOMETRIES_ADAPTED_STD_VARIANT_HPP