]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/include/boost/geometry/algorithms/detail/is_simple/interface.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / geometry / include / boost / geometry / algorithms / detail / is_simple / interface.hpp
1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2
3 // Copyright (c) 2014, Oracle and/or its affiliates.
4
5 // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle
6
7 // Licensed under the Boost Software License version 1.0.
8 // http://www.boost.org/users/license.html
9
10 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_INTERFACE_HPP
11 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_INTERFACE_HPP
12
13 #include <boost/variant/apply_visitor.hpp>
14 #include <boost/variant/static_visitor.hpp>
15 #include <boost/variant/variant_fwd.hpp>
16
17 #include <boost/geometry/geometries/concepts/check.hpp>
18
19 #include <boost/geometry/algorithms/dispatch/is_simple.hpp>
20
21
22 namespace boost { namespace geometry
23 {
24
25
26 namespace resolve_variant {
27
28 template <typename Geometry>
29 struct is_simple
30 {
31 static inline bool apply(Geometry const& geometry)
32 {
33 concepts::check<Geometry const>();
34 return dispatch::is_simple<Geometry>::apply(geometry);
35 }
36 };
37
38 template <BOOST_VARIANT_ENUM_PARAMS(typename T)>
39 struct is_simple<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >
40 {
41 struct visitor : boost::static_visitor<bool>
42 {
43 template <typename Geometry>
44 bool operator()(Geometry const& geometry) const
45 {
46 return is_simple<Geometry>::apply(geometry);
47 }
48 };
49
50 static inline bool
51 apply(boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> const& geometry)
52 {
53 return boost::apply_visitor(visitor(), geometry);
54 }
55 };
56
57 } // namespace resolve_variant
58
59
60
61 /*!
62 \brief \brief_check{is simple}
63 \ingroup is_simple
64 \tparam Geometry \tparam_geometry
65 \param geometry \param_geometry
66 \return \return_check{is simple}
67
68 \qbk{[include reference/algorithms/is_simple.qbk]}
69 */
70 template <typename Geometry>
71 inline bool is_simple(Geometry const& geometry)
72 {
73 return resolve_variant::is_simple<Geometry>::apply(geometry);
74 }
75
76
77 }} // namespace boost::geometry
78
79
80 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_IS_SIMPLE_INTERFACE_HPP