X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Fboost%2Fgeometry%2Falgorithms%2Fdetail%2Fselect_geometry_type.hpp;fp=ceph%2Fsrc%2Fboost%2Fboost%2Fgeometry%2Falgorithms%2Fdetail%2Fselect_geometry_type.hpp;h=5592fa5c4b4d37069767cc869bfe7263d0cf28f5;hb=1e59de90020f1d8d374046ef9cca56ccd4e806e2;hp=0000000000000000000000000000000000000000;hpb=bd41e436e25044e8e83156060a37c23cb661c364;p=ceph.git diff --git a/ceph/src/boost/boost/geometry/algorithms/detail/select_geometry_type.hpp b/ceph/src/boost/boost/geometry/algorithms/detail/select_geometry_type.hpp new file mode 100644 index 000000000..5592fa5c4 --- /dev/null +++ b/ceph/src/boost/boost/geometry/algorithms/detail/select_geometry_type.hpp @@ -0,0 +1,142 @@ +// 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_ALGORITHMS_DETAIL_SELECT_GEOMETRY_TYPE_HPP +#define BOOST_GEOMETRY_ALGORITHMS_DETAIL_SELECT_GEOMETRY_TYPE_HPP + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace geometry +{ + +#ifndef DOXYGEN_NO_DETAIL +namespace detail +{ + + +template ::type> +struct first_geometry_type +{ + using type = Geometry; +}; + +template +struct first_geometry_type +{ + template + using pred = util::bool_constant + < + ! util::is_dynamic_geometry::value + && ! util::is_geometry_collection::value + >; + + using type = typename util::sequence_find_if + < + typename traits::geometry_types::type, + pred + >::type; +}; + +template +struct first_geometry_type + : first_geometry_type +{}; + + +template +< + typename Geometry, + bool IsDynamicOrCollection = util::is_dynamic_geometry::value + || util::is_geometry_collection::value +> +struct geometry_types +{ + using type = util::type_sequence>; +}; + +template +struct geometry_types +{ + using type = typename traits::geometry_types>::type; +}; + + +template +< + typename Geometry, + template class LessPred, + bool IsDynamicOrCollection = util::is_dynamic_geometry::value + || util::is_geometry_collection::value +> +struct select_geometry_type +{ + using type = Geometry; +}; + +template +< + typename Geometry, + template class LessPred +> +struct select_geometry_type + : util::sequence_min_element + < + typename traits::geometry_types>::type, + LessPred + > +{}; + + +template +< + typename Geometry1, typename Geometry2, + template class LessPred, + bool IsDynamicOrCollection = util::is_dynamic_geometry::value + || util::is_dynamic_geometry::value + || util::is_geometry_collection::value + || util::is_geometry_collection::value +> +struct select_geometry_types +{ + using type = util::type_sequence + < + std::remove_const_t, + std::remove_const_t + >; +}; + +template +< + typename Geometry1, typename Geometry2, + template class LessPred +> +struct select_geometry_types + : util::sequence_min_element + < + typename util::sequence_combine + < + typename geometry_types::type, + typename geometry_types::type + >::type, + LessPred + > +{}; + + +} // namespace detail +#endif // DOXYGEN_NO_DETAIL + +}} // namespace boost::geometry + +#endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_SELECT_GEOMETRY_TYPE_HPP