diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-12-17 00:58:27 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-12-17 01:20:15 +0300 |
commit | 76fb25d3c68401815a12408f9ddf0c0134645f1b (patch) | |
tree | 86c53d7fc846d15d3c48263b21f22639e2dc21b6 | |
parent | 4925fc0d89de276c0971a54b3d3e5f3896b3ca2f (diff) | |
download | ydb-76fb25d3c68401815a12408f9ddf0c0134645f1b.tar.gz |
Update contrib/restricted/boost/core to 1.84.0
7 files changed, 132 insertions, 60 deletions
diff --git a/contrib/restricted/boost/config/include/boost/config/header_deprecated.hpp b/contrib/restricted/boost/config/include/boost/config/header_deprecated.hpp new file mode 100644 index 0000000000..120b4b3a92 --- /dev/null +++ b/contrib/restricted/boost/config/include/boost/config/header_deprecated.hpp @@ -0,0 +1,26 @@ +#ifndef BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED +#define BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED + +// Copyright 2017 Peter Dimov. +// +// 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 +// +// BOOST_HEADER_DEPRECATED("<alternative>") +// +// Expands to the equivalent of +// BOOST_PRAGMA_MESSAGE("This header is deprecated. Use <alternative> instead.") +// +// Note that this header is C compatible. + +#include <boost/config/pragma_message.hpp> + +#if defined(BOOST_ALLOW_DEPRECATED_HEADERS) || defined(BOOST_ALLOW_DEPRECATED) +# define BOOST_HEADER_DEPRECATED(a) +#else +# define BOOST_HEADER_DEPRECATED(a) BOOST_PRAGMA_MESSAGE("This header is deprecated. Use " a " instead.") +#endif + +#endif // BOOST_CONFIG_HEADER_DEPRECATED_HPP_INCLUDED diff --git a/contrib/restricted/boost/core/include/boost/core/detail/sp_thread_pause.hpp b/contrib/restricted/boost/core/include/boost/core/detail/sp_thread_pause.hpp index 01be1a0638..8971fbd1eb 100644 --- a/contrib/restricted/boost/core/include/boost/core/detail/sp_thread_pause.hpp +++ b/contrib/restricted/boost/core/include/boost/core/detail/sp_thread_pause.hpp @@ -20,7 +20,7 @@ #include <boost/config.hpp> #if defined(__has_builtin) -# if __has_builtin(__builtin_ia32_pause) && !defined(_INTEL_COMPILER) +# if __has_builtin(__builtin_ia32_pause) && !defined(__INTEL_COMPILER) # define BOOST_CORE_HAS_BUILTIN_IA32_PAUSE # endif #endif diff --git a/contrib/restricted/boost/core/include/boost/core/invoke_swap.hpp b/contrib/restricted/boost/core/include/boost/core/invoke_swap.hpp new file mode 100644 index 0000000000..8056289553 --- /dev/null +++ b/contrib/restricted/boost/core/include/boost/core/invoke_swap.hpp @@ -0,0 +1,93 @@ +// Copyright (C) 2007, 2008 Steven Watanabe, Joseph Gauterin, Niels Dekker +// Copyright (C) 2023 Andrey Semashev +// +// 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) +// For more information, see http://www.boost.org + +#ifndef BOOST_CORE_INVOKE_SWAP_HPP +#define BOOST_CORE_INVOKE_SWAP_HPP + +// Note: the implementation of this utility contains various workarounds: +// - invoke_swap_impl is put outside the boost namespace, to avoid infinite +// recursion (causing stack overflow) when swapping objects of a primitive +// type. +// - std::swap is imported with a using-directive, rather than +// a using-declaration, because some compilers (including MSVC 7.1, +// Borland 5.9.3, and Intel 8.1) don't do argument-dependent lookup +// when it has a using-declaration instead. +// - The main entry function is called invoke_swap rather than swap +// to avoid forming an infinite recursion when the arguments are not +// swappable. + +#include <boost/core/enable_if.hpp> +#include <boost/config.hpp> +#if __cplusplus >= 201103L || defined(BOOST_DINKUMWARE_STDLIB) +#include <utility> // for std::swap (C++11) +#else +#include <algorithm> // for std::swap (C++98) +#endif +#include <cstddef> // for std::size_t + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +#if defined(BOOST_GCC) && (BOOST_GCC < 40700) +// gcc 4.6 ICEs on noexcept specifications below +#define BOOST_CORE_SWAP_NOEXCEPT_IF(x) +#else +#define BOOST_CORE_SWAP_NOEXCEPT_IF(x) BOOST_NOEXCEPT_IF(x) +#endif + +namespace boost_swap_impl { + +// we can't use type_traits here + +template<class T> struct is_const { enum _vt { value = 0 }; }; +template<class T> struct is_const<T const> { enum _vt { value = 1 }; }; + +// Use std::swap if argument dependent lookup fails. +// We need to have this at namespace scope to be able to use unqualified swap() call +// in noexcept specification. +using namespace std; + +template<class T> +BOOST_GPU_ENABLED +inline void invoke_swap_impl(T& left, T& right) BOOST_CORE_SWAP_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(swap(left, right))) +{ + swap(left, right); +} + +template<class T, std::size_t N> +BOOST_GPU_ENABLED +inline void invoke_swap_impl(T (& left)[N], T (& right)[N]) + BOOST_CORE_SWAP_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(::boost_swap_impl::invoke_swap_impl(left[0], right[0]))) +{ + for (std::size_t i = 0; i < N; ++i) + { + ::boost_swap_impl::invoke_swap_impl(left[i], right[i]); + } +} + +} // namespace boost_swap_impl + +namespace boost { +namespace core { + +template<class T> +BOOST_GPU_ENABLED +inline typename enable_if_c< !::boost_swap_impl::is_const<T>::value >::type +invoke_swap(T& left, T& right) + BOOST_CORE_SWAP_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(::boost_swap_impl::invoke_swap_impl(left, right))) +{ + ::boost_swap_impl::invoke_swap_impl(left, right); +} + +} // namespace core +} // namespace boost + +#undef BOOST_CORE_SWAP_NOEXCEPT_IF + +#endif // BOOST_CORE_INVOKE_SWAP_HPP diff --git a/contrib/restricted/boost/core/include/boost/core/swap.hpp b/contrib/restricted/boost/core/include/boost/core/swap.hpp index 7add2fbf8b..882c75640a 100644 --- a/contrib/restricted/boost/core/include/boost/core/swap.hpp +++ b/contrib/restricted/boost/core/include/boost/core/swap.hpp @@ -10,80 +10,29 @@ #define BOOST_CORE_SWAP_HPP // Note: the implementation of this utility contains various workarounds: -// - swap_impl is put outside the boost namespace, to avoid infinite -// recursion (causing stack overflow) when swapping objects of a primitive -// type. -// - std::swap is imported with a using-directive, rather than -// a using-declaration, because some compilers (including MSVC 7.1, -// Borland 5.9.3, and Intel 8.1) don't do argument-dependent lookup -// when it has a using-declaration instead. // - boost::swap has two template arguments, instead of one, to // avoid ambiguity when swapping objects of a Boost type that does // not have its own boost::swap overload. #include <boost/core/enable_if.hpp> #include <boost/config.hpp> -#if __cplusplus >= 201103L || defined(BOOST_DINKUMWARE_STDLIB) -#include <utility> // for std::swap (C++11) -#else -#include <algorithm> // for std::swap (C++98) -#endif -#include <cstddef> // for std::size_t +#include <boost/config/header_deprecated.hpp> +#include <boost/core/invoke_swap.hpp> #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif -#if defined(BOOST_GCC) && (BOOST_GCC < 40700) -// gcc 4.6 ICEs on noexcept specifications below -#define BOOST_CORE_SWAP_NOEXCEPT_IF(x) -#else -#define BOOST_CORE_SWAP_NOEXCEPT_IF(x) BOOST_NOEXCEPT_IF(x) -#endif - -namespace boost_swap_impl -{ - // we can't use type_traits here - - template<class T> struct is_const { enum _vt { value = 0 }; }; - template<class T> struct is_const<T const> { enum _vt { value = 1 }; }; - - // Use std::swap if argument dependent lookup fails. - // We need to have this at namespace scope to be able to use unqualified swap() call - // in noexcept specification. - using namespace std; - - template<class T> - BOOST_GPU_ENABLED - void swap_impl(T& left, T& right) BOOST_CORE_SWAP_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(swap(left, right))) - { - swap(left, right); - } - - template<class T, std::size_t N> - BOOST_GPU_ENABLED - void swap_impl(T (& left)[N], T (& right)[N]) - BOOST_CORE_SWAP_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(::boost_swap_impl::swap_impl(left[0], right[0]))) - { - for (std::size_t i = 0; i < N; ++i) - { - ::boost_swap_impl::swap_impl(left[i], right[i]); - } - } -} namespace boost { template<class T1, class T2> BOOST_GPU_ENABLED - typename enable_if_c< !boost_swap_impl::is_const<T1>::value && !boost_swap_impl::is_const<T2>::value >::type + inline typename enable_if_c< !boost_swap_impl::is_const<T1>::value && !boost_swap_impl::is_const<T2>::value >::type swap(T1& left, T2& right) - BOOST_CORE_SWAP_NOEXCEPT_IF(BOOST_NOEXCEPT_EXPR(::boost_swap_impl::swap_impl(left, right))) { - ::boost_swap_impl::swap_impl(left, right); + boost::core::invoke_swap(left, right); } } -#undef BOOST_CORE_SWAP_NOEXCEPT_IF - #endif // BOOST_CORE_SWAP_HPP diff --git a/contrib/restricted/boost/core/include/boost/swap.hpp b/contrib/restricted/boost/core/include/boost/swap.hpp index 55cafa4fdd..9a509bbbbf 100644 --- a/contrib/restricted/boost/core/include/boost/swap.hpp +++ b/contrib/restricted/boost/core/include/boost/swap.hpp @@ -10,8 +10,10 @@ #define BOOST_SWAP_HPP // The header file at this path is deprecated; -// use boost/core/swap.hpp instead. +// use boost/core/invoke_swap.hpp instead. +#include <boost/config/header_deprecated.hpp> #include <boost/core/swap.hpp> + #endif diff --git a/contrib/restricted/boost/core/include/boost/utility/swap.hpp b/contrib/restricted/boost/core/include/boost/utility/swap.hpp index dd9ecd9070..998f4bb411 100644 --- a/contrib/restricted/boost/core/include/boost/utility/swap.hpp +++ b/contrib/restricted/boost/core/include/boost/utility/swap.hpp @@ -10,8 +10,10 @@ #define BOOST_UTILITY_SWAP_HPP // The header file at this path is deprecated; -// use boost/core/swap.hpp instead. +// use boost/core/invoke_swap.hpp instead. +#include <boost/config/header_deprecated.hpp> #include <boost/core/swap.hpp> + #endif diff --git a/contrib/restricted/boost/core/ya.make b/contrib/restricted/boost/core/ya.make index 126af6a736..659d5028d3 100644 --- a/contrib/restricted/boost/core/ya.make +++ b/contrib/restricted/boost/core/ya.make @@ -9,9 +9,9 @@ LICENSE( LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(1.83.0) +VERSION(1.84.0) -ORIGINAL_SOURCE(https://github.com/boostorg/core/archive/boost-1.83.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/core/archive/boost-1.84.0.tar.gz) PEERDIR( contrib/restricted/boost/assert |