From bb27117b9fffee67d433e1fdee486dccaeeb9502 Mon Sep 17 00:00:00 2001 From: robot-contrib Date: Thu, 19 Dec 2024 07:21:37 +0300 Subject: Update contrib/restricted/boost/mp11 to 1.87.0 commit_hash:40927cc9b86aa64dfa64c1c3c09e868d7b7f7a35 --- .../mp11/.yandex_meta/devtools.copyrights.report | 23 ++- .../mp11/.yandex_meta/devtools.licenses.report | 1 + .../boost/mp11/.yandex_meta/licenses.list.txt | 8 + .../restricted/boost/mp11/include/boost/mp11.hpp | 3 +- .../mp11/include/boost/mp11/detail/mp_count.hpp | 8 +- .../boost/mp11/include/boost/mp11/lambda.hpp | 199 +++++++++++++++++++++ .../boost/mp11/include/boost/mp11/version.hpp | 2 +- contrib/restricted/boost/mp11/ya.make | 4 +- 8 files changed, 239 insertions(+), 9 deletions(-) create mode 100644 contrib/restricted/boost/mp11/include/boost/mp11/lambda.hpp diff --git a/contrib/restricted/boost/mp11/.yandex_meta/devtools.copyrights.report b/contrib/restricted/boost/mp11/.yandex_meta/devtools.copyrights.report index 2ad71a9b96c..64821341395 100644 --- a/contrib/restricted/boost/mp11/.yandex_meta/devtools.copyrights.report +++ b/contrib/restricted/boost/mp11/.yandex_meta/devtools.copyrights.report @@ -81,7 +81,6 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - include/boost/mp11.hpp [4:4] include/boost/mp11/detail/mp_map_find.hpp [4:4] include/boost/mp11/detail/mp_plus.hpp [4:4] include/boost/mp11/integral.hpp [4:4] @@ -136,6 +135,17 @@ BELONGS ya.make include/boost/mp11/detail/mp_count.hpp [4:4] include/boost/mp11/detail/mp_list.hpp [4:4] +KEEP COPYRIGHT_SERVICE_LABEL aa53a493e659c97cf28c1683cd4be365 +BELONGS ya.make + License text: + // Copyright 2015-2024 Peter Dimov. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + include/boost/mp11.hpp [4:4] + KEEP COPYRIGHT_SERVICE_LABEL b280e59de7ebe0b280acf5004569984f BELONGS ya.make License text: @@ -160,6 +170,17 @@ BELONGS ya.make include/boost/mp11/detail/mp_rename.hpp [4:4] include/boost/mp11/list.hpp [4:4] +KEEP COPYRIGHT_SERVICE_LABEL c2c38b6a2143de73450b97fc281564d1 +BELONGS ya.make + License text: + // Copyright 2024 Joaquin M Lopez Munoz. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + include/boost/mp11/lambda.hpp [4:4] + KEEP COPYRIGHT_SERVICE_LABEL cd293b74a3df4ce171f943aaee35b153 BELONGS ya.make License text: diff --git a/contrib/restricted/boost/mp11/.yandex_meta/devtools.licenses.report b/contrib/restricted/boost/mp11/.yandex_meta/devtools.licenses.report index f419b993766..232899b96ef 100644 --- a/contrib/restricted/boost/mp11/.yandex_meta/devtools.licenses.report +++ b/contrib/restricted/boost/mp11/.yandex_meta/devtools.licenses.report @@ -87,6 +87,7 @@ BELONGS ya.make include/boost/mp11/detail/mp_void.hpp [6:9] include/boost/mp11/detail/mp_with_index.hpp [6:9] include/boost/mp11/integral.hpp [6:9] + include/boost/mp11/lambda.hpp [6:9] include/boost/mp11/list.hpp [6:9] include/boost/mp11/map.hpp [6:9] include/boost/mp11/tuple.hpp [6:9] diff --git a/contrib/restricted/boost/mp11/.yandex_meta/licenses.list.txt b/contrib/restricted/boost/mp11/.yandex_meta/licenses.list.txt index 6af4f2f4ac3..f8a79dab2eb 100644 --- a/contrib/restricted/boost/mp11/.yandex_meta/licenses.list.txt +++ b/contrib/restricted/boost/mp11/.yandex_meta/licenses.list.txt @@ -58,6 +58,10 @@ Distributed under the [Boost Software License, Version 1.0](http://boost.org/LIC // Copyright 2015-2023 Peter Dimov. +====================COPYRIGHT==================== +// Copyright 2015-2024 Peter Dimov. + + ====================COPYRIGHT==================== // Copyright 2017 Peter Dimov. @@ -70,6 +74,10 @@ Distributed under the [Boost Software License, Version 1.0](http://boost.org/LIC // Copyright 2019 Peter Dimov +====================COPYRIGHT==================== +// Copyright 2024 Joaquin M Lopez Munoz. + + ====================COPYRIGHT==================== // Copyright 2015, 2017, 2019 Peter Dimov. diff --git a/contrib/restricted/boost/mp11/include/boost/mp11.hpp b/contrib/restricted/boost/mp11/include/boost/mp11.hpp index 5e459395fe5..799a3063a8e 100644 --- a/contrib/restricted/boost/mp11/include/boost/mp11.hpp +++ b/contrib/restricted/boost/mp11/include/boost/mp11.hpp @@ -1,7 +1,7 @@ #ifndef BOOST_MP11_HPP_INCLUDED #define BOOST_MP11_HPP_INCLUDED -// Copyright 2015 Peter Dimov. +// Copyright 2015-2024 Peter Dimov. // // Distributed under the Boost Software License, Version 1.0. // @@ -16,6 +16,7 @@ #include #include #include +#include #include #include diff --git a/contrib/restricted/boost/mp11/include/boost/mp11/detail/mp_count.hpp b/contrib/restricted/boost/mp11/include/boost/mp11/detail/mp_count.hpp index 37b39ed5474..bc8aed93e9f 100644 --- a/contrib/restricted/boost/mp11/include/boost/mp11/detail/mp_count.hpp +++ b/contrib/restricted/boost/mp11/include/boost/mp11/detail/mp_count.hpp @@ -51,9 +51,9 @@ template constexpr std::size_t cx_count() std::size_t r = 0; - for( std::size_t i = 1; i < sizeof...(T) + 1; ++i ) + for( std::size_t i = 0; i < sizeof...(T); ++i ) { - r += a[ i ]; + r += a[ i+1 ]; } return r; @@ -98,9 +98,9 @@ template class P, class... T> constexpr std::size_t cx_count_ std::size_t r = 0; - for( std::size_t i = 1; i < sizeof...(T) + 1; ++i ) + for( std::size_t i = 0; i < sizeof...(T); ++i ) { - r += a[ i ]; + r += a[ i+1 ]; } return r; diff --git a/contrib/restricted/boost/mp11/include/boost/mp11/lambda.hpp b/contrib/restricted/boost/mp11/include/boost/mp11/lambda.hpp new file mode 100644 index 00000000000..3d027c2a69c --- /dev/null +++ b/contrib/restricted/boost/mp11/include/boost/mp11/lambda.hpp @@ -0,0 +1,199 @@ +#ifndef BOOST_MP11_LAMBDA_HPP_INCLUDED +#define BOOST_MP11_LAMBDA_HPP_INCLUDED + +// Copyright 2024 Joaquin M Lopez Munoz. +// +// Distributed under 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 + +#if BOOST_MP11_WORKAROUND(BOOST_MP11_MSVC, <= 1800) + +// mp_lambda not supported due to compiler limitations + +#else + +#include +#include +#include + +#if defined(_MSC_VER) || defined(__GNUC__) +# pragma push_macro( "I" ) +# undef I +#endif + +namespace boost +{ +namespace mp11 +{ +namespace detail +{ + +template struct lambda_impl; + +} // namespace detail + +// mp_lambda +template using mp_lambda = typename detail::lambda_impl::type; + +namespace detail +{ + +// base case (no placeholder replacement) +template struct lambda_impl +{ + template using make = T; + using type = mp_bind; +}; + +// placeholders (behave directly as mp_bind expressions) +template struct lambda_impl> +{ + using type = mp_arg; +}; + +#define BOOST_MP11_SPECIALIZE_LAMBDA_IMPL(name, compound_type) \ +template using lambda_make_##name = compound_type; \ + \ +template struct lambda_impl \ +{ \ + using type = mp_bind>; \ +}; + +// [basic.type.qualifier] +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL(const, const T) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL(volatile, volatile T) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL(const_volatile, const volatile T) + +// [dcl.ptr] +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL(pointer, T*) + +// [dcl.ref] +// GCC < 7 fails with template using make = U&; +template struct lambda_impl +{ + template using make = typename std::add_lvalue_reference::type; + using type = mp_bind>; +}; + +template struct lambda_impl +{ + template using make = typename std::add_rvalue_reference::type; + using type = mp_bind>; +}; + +// [dcl.array] +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL(array, T[]) + +#undef BOOST_MP11_SPECIALIZE_LAMBDA_IMPL + +template struct lambda_impl +{ + template using make = Q[N]; + using type = mp_bind>; +}; + +// [dcl.fct], [dcl.mptr] (member functions) +#define BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(name, qualifier) \ +template using lambda_make_fct_##name = R(T...) qualifier; \ + \ +template struct lambda_impl \ +{ \ + using type = mp_bind< \ + lambda_make_fct_##name, \ + mp_lambda, mp_lambda...>; \ +}; \ + \ +template using lambda_make_fct_##name##_ellipsis = \ + R(T..., ...) qualifier; \ + \ +template struct lambda_impl \ +{ \ + using type = mp_bind< \ + lambda_make_fct_##name##_ellipsis, \ + mp_lambda, mp_lambda...>; \ +}; \ + \ +template using lambda_make_mfptr_##name = \ + R (C::*)(T...) qualifier; \ + \ +template struct lambda_impl \ +{ \ + using type = mp_bind< \ + lambda_make_mfptr_##name, \ + mp_lambda, mp_lambda, mp_lambda...>; \ +}; \ + \ +template using lambda_make_mfptr_##name##_ellipsis = \ + R (C::*)(T..., ...) qualifier; \ + \ +template struct lambda_impl \ +{ \ + using type = mp_bind< \ + lambda_make_mfptr_##name##_ellipsis, \ + mp_lambda, mp_lambda, mp_lambda...>; \ +}; + +#define BOOST_MP11_LAMBDA_EMPTY() + +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(no_qualifier, BOOST_MP11_LAMBDA_EMPTY()) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const, const) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(volatile, volatile) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_volatile, const volatile) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(ref, &) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_ref, const&) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(volatile_ref, volatile&) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_volatile_ref, const volatile&) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(rvalue_ref, &&) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_rvalue_ref, const&&) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(volatile_rvalue_ref, volatile&&) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_volatile_rvalue_ref, const volatile&&) + +#if (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L + +// P0012R1: exception specification as part of the type system +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(noexcept, noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_noexcept, const noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(volatile_noexcept, volatile noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_volatile_noexcept, const volatile noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(ref_noexcept, & noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_ref_noexcept, const& noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(volatile_ref_noexcept, volatile& noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_volatile_ref_noexcept, const volatile& noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(rvalue_ref_noexcept, && noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_rvalue_ref_noexcept, const&& noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(volatile_rvalue_ref_noexcept, volatile&& noexcept) +BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR(const_volatile_rvalue_ref_noexcept, const volatile&& noexcept) + +#endif // P0012R1 + +#undef BOOST_MP11_LAMBDA_EMPTY +#undef BOOST_MP11_SPECIALIZE_LAMBDA_IMPL_FCT_AND_MFPTR + +// [dcl.mptr] (data members) +template struct lambda_impl +{ + template using make = U D::*; + using type = mp_bind, mp_lambda>; +}; + +// template class instantiation +template