diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-12-17 03:52:01 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-12-17 04:20:22 +0300 |
commit | d9972831aeb936b5588c71b7583d5e078d830044 (patch) | |
tree | 3ab96cd3e38b85694c7f2339bdde0fca11c45641 /contrib/restricted | |
parent | 961355e37505c70e0b4847a4df4d92be1a30a704 (diff) | |
download | ydb-d9972831aeb936b5588c71b7583d5e078d830044.tar.gz |
Update contrib/restricted/boost/any to 1.84.0
Diffstat (limited to 'contrib/restricted')
10 files changed, 51 insertions, 144 deletions
diff --git a/contrib/restricted/boost/any/CMakeLists.darwin-arm64.txt b/contrib/restricted/boost/any/CMakeLists.darwin-arm64.txt index 946a109665..1927965a1c 100644 --- a/contrib/restricted/boost/any/CMakeLists.darwin-arm64.txt +++ b/contrib/restricted/boost/any/CMakeLists.darwin-arm64.txt @@ -14,9 +14,6 @@ target_include_directories(restricted-boost-any INTERFACE target_link_libraries(restricted-boost-any INTERFACE contrib-libs-cxxsupp restricted-boost-config - restricted-boost-core - restricted-boost-static_assert restricted-boost-throw_exception restricted-boost-type_index - restricted-boost-type_traits ) diff --git a/contrib/restricted/boost/any/CMakeLists.darwin-x86_64.txt b/contrib/restricted/boost/any/CMakeLists.darwin-x86_64.txt index 946a109665..1927965a1c 100644 --- a/contrib/restricted/boost/any/CMakeLists.darwin-x86_64.txt +++ b/contrib/restricted/boost/any/CMakeLists.darwin-x86_64.txt @@ -14,9 +14,6 @@ target_include_directories(restricted-boost-any INTERFACE target_link_libraries(restricted-boost-any INTERFACE contrib-libs-cxxsupp restricted-boost-config - restricted-boost-core - restricted-boost-static_assert restricted-boost-throw_exception restricted-boost-type_index - restricted-boost-type_traits ) diff --git a/contrib/restricted/boost/any/CMakeLists.linux-aarch64.txt b/contrib/restricted/boost/any/CMakeLists.linux-aarch64.txt index b1d4845050..d93fd9601e 100644 --- a/contrib/restricted/boost/any/CMakeLists.linux-aarch64.txt +++ b/contrib/restricted/boost/any/CMakeLists.linux-aarch64.txt @@ -15,9 +15,6 @@ target_link_libraries(restricted-boost-any INTERFACE contrib-libs-linux-headers contrib-libs-cxxsupp restricted-boost-config - restricted-boost-core - restricted-boost-static_assert restricted-boost-throw_exception restricted-boost-type_index - restricted-boost-type_traits ) diff --git a/contrib/restricted/boost/any/CMakeLists.linux-x86_64.txt b/contrib/restricted/boost/any/CMakeLists.linux-x86_64.txt index b1d4845050..d93fd9601e 100644 --- a/contrib/restricted/boost/any/CMakeLists.linux-x86_64.txt +++ b/contrib/restricted/boost/any/CMakeLists.linux-x86_64.txt @@ -15,9 +15,6 @@ target_link_libraries(restricted-boost-any INTERFACE contrib-libs-linux-headers contrib-libs-cxxsupp restricted-boost-config - restricted-boost-core - restricted-boost-static_assert restricted-boost-throw_exception restricted-boost-type_index - restricted-boost-type_traits ) diff --git a/contrib/restricted/boost/any/CMakeLists.windows-x86_64.txt b/contrib/restricted/boost/any/CMakeLists.windows-x86_64.txt index 946a109665..1927965a1c 100644 --- a/contrib/restricted/boost/any/CMakeLists.windows-x86_64.txt +++ b/contrib/restricted/boost/any/CMakeLists.windows-x86_64.txt @@ -14,9 +14,6 @@ target_include_directories(restricted-boost-any INTERFACE target_link_libraries(restricted-boost-any INTERFACE contrib-libs-cxxsupp restricted-boost-config - restricted-boost-core - restricted-boost-static_assert restricted-boost-throw_exception restricted-boost-type_index - restricted-boost-type_traits ) diff --git a/contrib/restricted/boost/any/include/boost/any.hpp b/contrib/restricted/boost/any/include/boost/any.hpp index 1500964c37..f7812eef9f 100644 --- a/contrib/restricted/boost/any/include/boost/any.hpp +++ b/contrib/restricted/boost/any/include/boost/any.hpp @@ -21,19 +21,11 @@ #include <boost/any/bad_any_cast.hpp> #include <boost/any/fwd.hpp> #include <boost/any/detail/placeholder.hpp> -#include <boost/type_index.hpp> -#include <boost/type_traits/remove_reference.hpp> -#include <boost/type_traits/decay.hpp> -#include <boost/type_traits/remove_cv.hpp> -#include <boost/type_traits/add_reference.hpp> -#include <boost/type_traits/is_reference.hpp> -#include <boost/type_traits/is_const.hpp> #include <boost/throw_exception.hpp> -#include <boost/static_assert.hpp> -#include <boost/core/enable_if.hpp> -#include <boost/core/addressof.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/type_traits/conditional.hpp> +#include <boost/type_index.hpp> + +#include <memory> // for std::addressof +#include <type_traits> namespace boost { @@ -44,7 +36,7 @@ namespace boost public: /// \post this->empty() is true. - BOOST_CONSTEXPR any() BOOST_NOEXCEPT + constexpr any() noexcept : content(0) { } @@ -58,10 +50,10 @@ namespace boost template<typename ValueType> any(const ValueType & value) : content(new holder< - BOOST_DEDUCED_TYPENAME remove_cv<BOOST_DEDUCED_TYPENAME decay<const ValueType>::type>::type + typename std::remove_cv<typename std::decay<const ValueType>::type>::type >(value)) { - BOOST_STATIC_ASSERT_MSG( + static_assert( !anys::detail::is_basic_any<ValueType>::value, "boost::any shall not be constructed from boost::anys::basic_any" ); @@ -80,14 +72,12 @@ namespace boost { } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES /// Move constructor that moves content of /// `other` into new instance and leaves `other` empty. /// - /// \pre C++11 compatible compiler /// \post other->empty() is true /// \throws Nothing. - any(any&& other) BOOST_NOEXCEPT + any(any&& other) noexcept : content(other.content) { other.content = 0; @@ -97,26 +87,24 @@ namespace boost /// that the initial content of the new instance is equivalent /// in both type and value to `value` before the forward. /// - /// \pre C++11 compatible compiler. /// \throws std::bad_alloc or any exceptions arising from the move or /// copy constructor of the contained type. template<typename ValueType> any(ValueType&& value - , typename boost::disable_if<boost::is_same<any&, ValueType> >::type* = 0 // disable if value has type `any&` - , typename boost::disable_if<boost::is_const<ValueType> >::type* = 0) // disable if value has type `const ValueType&&` - : content(new holder< typename decay<ValueType>::type >(static_cast<ValueType&&>(value))) + , typename std::enable_if<!std::is_same<any&, ValueType>::value >::type* = 0 // disable if value has type `any&` + , typename std::enable_if<!std::is_const<ValueType>::value >::type* = 0) // disable if value has type `const ValueType&&` + : content(new holder< typename std::decay<ValueType>::type >(std::forward<ValueType>(value))) { - BOOST_STATIC_ASSERT_MSG( - !anys::detail::is_basic_any<typename boost::decay<ValueType>::type>::value, + static_assert( + !anys::detail::is_basic_any<typename std::decay<ValueType>::type>::value, "boost::any shall not be constructed from boost::anys::basic_any" ); } -#endif /// Releases any and all resources used in management of instance. /// /// \throws Nothing. - ~any() BOOST_NOEXCEPT + ~any() noexcept { delete content; } @@ -127,7 +115,7 @@ namespace boost /// /// \returns `*this` /// \throws Nothing. - any & swap(any & rhs) BOOST_NOEXCEPT + any & swap(any & rhs) noexcept { placeholder* tmp = content; content = rhs.content; @@ -150,37 +138,15 @@ namespace boost return *this; } -#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES - /// Makes a copy of `rhs`, - /// discarding previous content, so that the new content of is - /// equivalent in both type and value to - /// `rhs`. - /// - /// \throws std::bad_alloc - /// or any exceptions arising from the copy constructor of the - /// contained type. Assignment satisfies the strong guarantee - /// of exception safety. - template<typename ValueType> - any & operator=(const ValueType & rhs) - { - BOOST_STATIC_ASSERT_MSG( - !anys::detail::is_basic_any<ValueType>::value, - "boost::anys::basic_any shall not be assigned into boost::any" - ); - any(rhs).swap(*this); - return *this; - } -#else /// Moves content of `rhs` into /// current instance, discarding previous content, so that the /// new content is equivalent in both type and value to the /// content of `rhs` before move, or empty if /// `rhs.empty()`. /// - /// \pre C++11 compatible compiler. /// \post `rhs->empty()` is true /// \throws Nothing. - any & operator=(any&& rhs) BOOST_NOEXCEPT + any & operator=(any&& rhs) noexcept { rhs.swap(*this); any().swap(rhs); @@ -192,7 +158,6 @@ namespace boost /// equivalent in both type and value to /// `rhs` before forward. /// - /// \pre C++11 compatible compiler. /// \throws std::bad_alloc /// or any exceptions arising from the move or copy constructor of the /// contained type. Assignment satisfies the strong guarantee @@ -200,26 +165,25 @@ namespace boost template <class ValueType> any & operator=(ValueType&& rhs) { - BOOST_STATIC_ASSERT_MSG( - !anys::detail::is_basic_any<typename boost::decay<ValueType>::type>::value, + static_assert( + !anys::detail::is_basic_any<typename std::decay<ValueType>::type>::value, "boost::anys::basic_any shall not be assigned into boost::any" ); - any(static_cast<ValueType&&>(rhs)).swap(*this); + any(std::forward<ValueType>(rhs)).swap(*this); return *this; } -#endif public: // queries /// \returns `true` if instance is empty, otherwise `false`. /// \throws Nothing. - bool empty() const BOOST_NOEXCEPT + bool empty() const noexcept { return !content; } /// \post this->empty() is true - void clear() BOOST_NOEXCEPT + void clear() noexcept { any().swap(*this); } @@ -230,16 +194,12 @@ namespace boost /// /// Useful for querying against types known either at compile time or /// only at runtime. - const boost::typeindex::type_info& type() const BOOST_NOEXCEPT + const boost::typeindex::type_info& type() const noexcept { return content ? content->type() : boost::typeindex::type_id<void>().type_info(); } -#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS private: // types -#else - public: // types (public so any_cast can be non-friend) -#endif /// @cond class BOOST_SYMBOL_VISIBLE placeholder: public boost::anys::detail::placeholder { @@ -248,10 +208,7 @@ namespace boost }; template<typename ValueType> - class holder -#ifndef BOOST_NO_CXX11_FINAL - final -#endif + class holder final : public placeholder { public: // structors @@ -261,15 +218,14 @@ namespace boost { } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES holder(ValueType&& value) : held(static_cast< ValueType&& >(value)) { } -#endif + public: // queries - const boost::typeindex::type_info& type() const BOOST_NOEXCEPT BOOST_OVERRIDE + const boost::typeindex::type_info& type() const noexcept override { return boost::typeindex::type_id<ValueType>().type_info(); } @@ -287,27 +243,19 @@ namespace boost holder & operator=(const holder &); }; -#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS - private: // representation template<typename ValueType> - friend ValueType * unsafe_any_cast(any *) BOOST_NOEXCEPT; + friend ValueType * unsafe_any_cast(any *) noexcept; friend class boost::anys::unique_any; -#else - - public: // representation (public so any_cast can be non-friend) - -#endif - placeholder * content; /// @endcond }; /// Exchange of the contents of `lhs` and `rhs`. /// \throws Nothing. - inline void swap(any & lhs, any & rhs) BOOST_NOEXCEPT + inline void swap(any & lhs, any & rhs) noexcept { lhs.swap(rhs); } @@ -320,15 +268,15 @@ namespace boost // use typeid() comparison, e.g., when our types may travel across // different shared libraries. template<typename ValueType> - inline ValueType * unsafe_any_cast(any * operand) BOOST_NOEXCEPT + inline ValueType * unsafe_any_cast(any * operand) noexcept { - return boost::addressof( + return std::addressof( static_cast<any::holder<ValueType> *>(operand->content)->held ); } template<typename ValueType> - inline const ValueType * unsafe_any_cast(const any * operand) BOOST_NOEXCEPT + inline const ValueType * unsafe_any_cast(const any * operand) noexcept { return boost::unsafe_any_cast<ValueType>(const_cast<any *>(operand)); } @@ -337,17 +285,17 @@ namespace boost /// \returns Pointer to a ValueType stored in `operand`, nullptr if /// `operand` does not contain specified `ValueType`. template<typename ValueType> - ValueType * any_cast(any * operand) BOOST_NOEXCEPT + ValueType * any_cast(any * operand) noexcept { return operand && operand->type() == boost::typeindex::type_id<ValueType>() - ? boost::unsafe_any_cast<BOOST_DEDUCED_TYPENAME boost::remove_cv<ValueType>::type>(operand) + ? boost::unsafe_any_cast<typename std::remove_cv<ValueType>::type>(operand) : 0; } /// \returns Const pointer to a ValueType stored in `operand`, nullptr if /// `operand` does not contain specified `ValueType`. template<typename ValueType> - inline const ValueType * any_cast(const any * operand) BOOST_NOEXCEPT + inline const ValueType * any_cast(const any * operand) noexcept { return boost::any_cast<ValueType>(const_cast<any *>(operand)); } @@ -358,9 +306,9 @@ namespace boost template<typename ValueType> ValueType any_cast(any & operand) { - typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref; + typedef typename std::remove_reference<ValueType>::type nonref; - nonref * result = boost::any_cast<nonref>(boost::addressof(operand)); + nonref * result = boost::any_cast<nonref>(std::addressof(operand)); if(!result) boost::throw_exception(bad_any_cast()); @@ -368,10 +316,10 @@ namespace boost // `ValueType` is not a reference. Example: // `static_cast<std::string>(*result);` // which is equal to `std::string(*result);` - typedef BOOST_DEDUCED_TYPENAME boost::conditional< - boost::is_reference<ValueType>::value, + typedef typename std::conditional< + std::is_reference<ValueType>::value, ValueType, - BOOST_DEDUCED_TYPENAME boost::add_reference<ValueType>::type + typename std::add_lvalue_reference<ValueType>::type >::type ref_type; #ifdef BOOST_MSVC @@ -390,25 +338,23 @@ namespace boost template<typename ValueType> inline ValueType any_cast(const any & operand) { - typedef BOOST_DEDUCED_TYPENAME remove_reference<ValueType>::type nonref; + typedef typename std::remove_reference<ValueType>::type nonref; return boost::any_cast<const nonref &>(const_cast<any &>(operand)); } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES /// \returns `ValueType` stored in `operand`, leaving the `operand` empty. /// \throws boost::bad_any_cast if `operand` does not contain /// specified `ValueType`. template<typename ValueType> inline ValueType any_cast(any&& operand) { - BOOST_STATIC_ASSERT_MSG( - boost::is_rvalue_reference<ValueType&&>::value /*true if ValueType is rvalue or just a value*/ - || boost::is_const< typename boost::remove_reference<ValueType>::type >::value, + static_assert( + std::is_rvalue_reference<ValueType&&>::value /*true if ValueType is rvalue or just a value*/ + || std::is_const< typename std::remove_reference<ValueType>::type >::value, "boost::any_cast shall not be used for getting nonconst references to temporary objects" ); return boost::any_cast<ValueType>(operand); } -#endif } // Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved. diff --git a/contrib/restricted/boost/any/include/boost/any/bad_any_cast.hpp b/contrib/restricted/boost/any/include/boost/any/bad_any_cast.hpp index e715938e71..ed456021a3 100644 --- a/contrib/restricted/boost/any/include/boost/any/bad_any_cast.hpp +++ b/contrib/restricted/boost/any/include/boost/any/bad_any_cast.hpp @@ -32,7 +32,7 @@ class BOOST_SYMBOL_VISIBLE bad_any_cast : #endif { public: - const char * what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE + const char * what() const BOOST_NOEXCEPT_OR_NOTHROW override { return "boost::bad_any_cast: " "failed conversion using boost::any_cast"; diff --git a/contrib/restricted/boost/any/include/boost/any/detail/placeholder.hpp b/contrib/restricted/boost/any/include/boost/any/detail/placeholder.hpp index df5db65495..360d78cb08 100644 --- a/contrib/restricted/boost/any/include/boost/any/detail/placeholder.hpp +++ b/contrib/restricted/boost/any/include/boost/any/detail/placeholder.hpp @@ -22,7 +22,7 @@ namespace detail { class BOOST_SYMBOL_VISIBLE placeholder { public: virtual ~placeholder() {} - virtual const boost::typeindex::type_info& type() const BOOST_NOEXCEPT = 0; + virtual const boost::typeindex::type_info& type() const noexcept = 0; }; } // namespace detail diff --git a/contrib/restricted/boost/any/include/boost/any/fwd.hpp b/contrib/restricted/boost/any/include/boost/any/fwd.hpp index 21c5bc9877..752f3aceff 100644 --- a/contrib/restricted/boost/any/include/boost/any/fwd.hpp +++ b/contrib/restricted/boost/any/include/boost/any/fwd.hpp @@ -16,27 +16,6 @@ /// \file boost/any/fwd.hpp /// \brief Forward declarations of Boost.Any library types. - -#include <boost/config/pragma_message.hpp> -#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) || \ - defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) || \ - defined(BOOST_NO_CXX11_CONSTEXPR) || \ - defined(BOOST_NO_CXX11_NULLPTR) || \ - defined(BOOST_NO_CXX11_NOEXCEPT) || \ - defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) || \ - defined(BOOST_NO_CXX11_FINAL) || \ - defined(BOOST_NO_CXX11_ALIGNOF) || \ - defined(BOOST_NO_CXX11_STATIC_ASSERT) || \ - defined(BOOST_NO_CXX11_SMART_PTR) || \ - defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) || \ - defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) - -BOOST_PRAGMA_MESSAGE("C++03 support is deprecated in Boost.Any 1.82 and will be removed in Boost.Any 1.84.") - -#endif - -#include <boost/type_traits/alignment_of.hpp> - /// @cond namespace boost { @@ -46,25 +25,25 @@ namespace anys { class unique_any; -template<std::size_t OptimizeForSize = sizeof(void*), std::size_t OptimizeForAlignment = boost::alignment_of<void*>::value> +template<std::size_t OptimizeForSize = sizeof(void*), std::size_t OptimizeForAlignment = alignof(void*)> class basic_any; namespace detail { template <class T> - struct is_basic_any: public boost::false_type {}; + struct is_basic_any: public std::false_type {}; template<std::size_t OptimizeForSize, std::size_t OptimizeForAlignment> - struct is_basic_any<boost::anys::basic_any<OptimizeForSize, OptimizeForAlignment> > : public boost::true_type {}; + struct is_basic_any<boost::anys::basic_any<OptimizeForSize, OptimizeForAlignment> > : public std::true_type {}; template <class T> struct is_some_any: public is_basic_any<T> {}; template <> - struct is_some_any<boost::any>: public boost::true_type {}; + struct is_some_any<boost::any>: public std::true_type {}; template <> - struct is_some_any<boost::anys::unique_any>: public boost::true_type {}; + struct is_some_any<boost::anys::unique_any>: public std::true_type {}; } // namespace detail diff --git a/contrib/restricted/boost/any/ya.make b/contrib/restricted/boost/any/ya.make index 378225550d..4b831e73c3 100644 --- a/contrib/restricted/boost/any/ya.make +++ b/contrib/restricted/boost/any/ya.make @@ -6,17 +6,14 @@ LICENSE(BSL-1.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(1.83.0) +VERSION(1.84.0) -ORIGINAL_SOURCE(https://github.com/boostorg/any/archive/boost-1.83.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/any/archive/boost-1.84.0.tar.gz) PEERDIR( contrib/restricted/boost/config - contrib/restricted/boost/core - contrib/restricted/boost/static_assert contrib/restricted/boost/throw_exception contrib/restricted/boost/type_index - contrib/restricted/boost/type_traits ) ADDINCL( |