File indexing completed on 2025-01-18 09:35:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_VARIANT2_HPP
0011 #define BOOST_GEOMETRY_GEOMETRIES_ADAPTED_BOOST_VARIANT2_HPP
0012
0013
0014 #include <utility>
0015
0016 #include <boost/variant2/variant.hpp>
0017
0018 #include <boost/geometry/core/geometry_types.hpp>
0019 #include <boost/geometry/core/tag.hpp>
0020 #include <boost/geometry/core/tags.hpp>
0021 #include <boost/geometry/core/visit.hpp>
0022 #include <boost/geometry/util/sequence.hpp>
0023
0024
0025 namespace boost { namespace geometry
0026 {
0027
0028 namespace traits
0029 {
0030
0031 template <typename ...Ts>
0032 struct tag<boost::variant2::variant<Ts...>>
0033 {
0034 using type = dynamic_geometry_tag;
0035 };
0036
0037 template <typename ...Ts>
0038 struct visit<boost::variant2::variant<Ts...>>
0039 {
0040 template <typename Function, typename Variant>
0041 static void apply(Function && function, Variant && variant)
0042 {
0043 boost::variant2::visit(std::forward<Function>(function),
0044 std::forward<Variant>(variant));
0045 }
0046 };
0047
0048 template <typename ...Ts, typename ...Us>
0049 struct visit<boost::variant2::variant<Ts...>, boost::variant2::variant<Us...>>
0050 {
0051 template <typename Function, typename Variant1, typename Variant2>
0052 static void apply(Function && function, Variant1 && variant1, Variant2 && variant2)
0053 {
0054 boost::variant2::visit(std::forward<Function>(function),
0055 std::forward<Variant1>(variant1),
0056 std::forward<Variant2>(variant2));
0057 }
0058 };
0059
0060 template <typename ...Ts>
0061 struct geometry_types<boost::variant2::variant<Ts...>>
0062 {
0063 using type = util::type_sequence<Ts...>;
0064 };
0065
0066
0067 }
0068
0069
0070 }}
0071
0072
0073 #endif