diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-08-14 21:01:37 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-08-15 02:17:03 +0300 |
commit | 8b9eecafb5b4cd263cbb85bc58186f9aa29a1ee0 (patch) | |
tree | d4b7d57961efd141dee0d1a5cdffc278ec78a0b7 | |
parent | e42aaca2003e4874e8ce78872ef177429d376e39 (diff) | |
download | ydb-8b9eecafb5b4cd263cbb85bc58186f9aa29a1ee0.tar.gz |
Update contrib/restricted/boost/atomic to 1.83.0
4 files changed, 54 insertions, 8 deletions
diff --git a/contrib/restricted/boost/atomic/include/boost/atomic/detail/atomic_ref_impl.hpp b/contrib/restricted/boost/atomic/include/boost/atomic/detail/atomic_ref_impl.hpp index 59e53332e1..086bdc1fac 100644 --- a/contrib/restricted/boost/atomic/include/boost/atomic/detail/atomic_ref_impl.hpp +++ b/contrib/restricted/boost/atomic/include/boost/atomic/detail/atomic_ref_impl.hpp @@ -27,6 +27,7 @@ #include <boost/atomic/detail/core_operations_emulated.hpp> #include <boost/atomic/detail/memory_order_utils.hpp> #include <boost/atomic/detail/type_traits/is_signed.hpp> +#include <boost/atomic/detail/type_traits/remove_cv.hpp> #include <boost/atomic/detail/type_traits/alignment_of.hpp> #include <boost/atomic/detail/type_traits/conditional.hpp> #include <boost/atomic/detail/type_traits/integral_constant.hpp> @@ -67,6 +68,7 @@ public: typedef T value_type; protected: + typedef typename atomics::detail::remove_cv< value_type >::type unqualified_value_type; typedef typename atomics::detail::conditional< atomics::detail::is_atomic_ref_lock_free< T, Signed, Interprocess >::value, atomics::detail::core_operations< sizeof(value_type), Signed, Interprocess >, @@ -88,7 +90,7 @@ protected: public: BOOST_FORCEINLINE explicit base_atomic_ref_common(value_type& v) BOOST_NOEXCEPT : m_value(atomics::detail::addressof(v)) { - BOOST_ATOMIC_DETAIL_CLEAR_PADDING(this->m_value); + BOOST_ATOMIC_DETAIL_CLEAR_PADDING(const_cast< unqualified_value_type* >(m_value)); } BOOST_FORCEINLINE value_type& value() const BOOST_NOEXCEPT { return *m_value; } @@ -96,7 +98,7 @@ public: protected: BOOST_FORCEINLINE storage_type& storage() const BOOST_NOEXCEPT { - return *reinterpret_cast< storage_type* >(m_value); + return *reinterpret_cast< storage_type* >(const_cast< unqualified_value_type* >(m_value)); } public: diff --git a/contrib/restricted/boost/atomic/include/boost/atomic/detail/bitwise_cast.hpp b/contrib/restricted/boost/atomic/include/boost/atomic/detail/bitwise_cast.hpp index c5387f461a..3318eb4455 100644 --- a/contrib/restricted/boost/atomic/include/boost/atomic/detail/bitwise_cast.hpp +++ b/contrib/restricted/boost/atomic/include/boost/atomic/detail/bitwise_cast.hpp @@ -20,6 +20,7 @@ #include <boost/atomic/detail/config.hpp> #include <boost/atomic/detail/addressof.hpp> #include <boost/atomic/detail/string_ops.hpp> +#include <boost/atomic/detail/type_traits/remove_cv.hpp> #include <boost/atomic/detail/type_traits/integral_constant.hpp> #include <boost/atomic/detail/type_traits/has_unique_object_representations.hpp> #include <boost/atomic/detail/header.hpp> @@ -82,7 +83,8 @@ BOOST_FORCEINLINE void clear_tail_padding_bits(To& to) BOOST_NOEXCEPT template< typename To, std::size_t FromValueSize, typename From > BOOST_FORCEINLINE To bitwise_cast_memcpy(From const& from) BOOST_NOEXCEPT { - To to; + typedef typename atomics::detail::remove_cv< To >::type unqualified_to_t; + unqualified_to_t to; #if !defined(BOOST_ATOMIC_NO_CLEAR_PADDING) From from2(from); BOOST_ATOMIC_DETAIL_CLEAR_PADDING(atomics::detail::addressof(from2)); @@ -90,14 +92,14 @@ BOOST_FORCEINLINE To bitwise_cast_memcpy(From const& from) BOOST_NOEXCEPT ( atomics::detail::addressof(to), atomics::detail::addressof(from2), - (FromValueSize < sizeof(To) ? FromValueSize : sizeof(To)) + (FromValueSize < sizeof(unqualified_to_t) ? FromValueSize : sizeof(unqualified_to_t)) ); #else BOOST_ATOMIC_DETAIL_MEMCPY ( atomics::detail::addressof(to), atomics::detail::addressof(from), - (FromValueSize < sizeof(To) ? FromValueSize : sizeof(To)) + (FromValueSize < sizeof(unqualified_to_t) ? FromValueSize : sizeof(unqualified_to_t)) ); #endif atomics::detail::clear_tail_padding_bits< FromValueSize >(to); @@ -110,7 +112,7 @@ template< typename To, std::size_t FromValueSize, typename From > BOOST_FORCEINLINE BOOST_ATOMIC_DETAIL_CONSTEXPR_BITWISE_CAST To bitwise_cast_impl(From const& from, atomics::detail::true_type) BOOST_NOEXCEPT { // This implementation is only called when the From type has no padding and From and To have the same size - return BOOST_ATOMIC_DETAIL_BIT_CAST(To, from); + return BOOST_ATOMIC_DETAIL_BIT_CAST(typename atomics::detail::remove_cv< To >::type, from); } template< typename To, std::size_t FromValueSize, typename From > diff --git a/contrib/restricted/boost/atomic/include/boost/atomic/detail/type_traits/remove_cv.hpp b/contrib/restricted/boost/atomic/include/boost/atomic/detail/type_traits/remove_cv.hpp new file mode 100644 index 0000000000..44621792f5 --- /dev/null +++ b/contrib/restricted/boost/atomic/include/boost/atomic/detail/type_traits/remove_cv.hpp @@ -0,0 +1,42 @@ +/* + * 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) + * + * Copyright (c) 2023 Andrey Semashev + */ +/*! + * \file atomic/detail/type_traits/remove_cv.hpp + * + * This header defines \c remove_cv type trait + */ + +#ifndef BOOST_ATOMIC_DETAIL_TYPE_TRAITS_REMOVE_CV_HPP_INCLUDED_ +#define BOOST_ATOMIC_DETAIL_TYPE_TRAITS_REMOVE_CV_HPP_INCLUDED_ + +#include <boost/atomic/detail/config.hpp> +#if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_BASIC_HDR_TYPE_TRAITS) +#include <type_traits> +#else +#include <boost/type_traits/remove_cv.hpp> +#endif + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace boost { +namespace atomics { +namespace detail { + +#if !defined(BOOST_ATOMIC_DETAIL_NO_CXX11_BASIC_HDR_TYPE_TRAITS) +using std::remove_cv; +#else +using boost::remove_cv; +#endif + +} // namespace detail +} // namespace atomics +} // namespace boost + +#endif // BOOST_ATOMIC_DETAIL_TYPE_TRAITS_REMOVE_CV_HPP_INCLUDED_ diff --git a/contrib/restricted/boost/atomic/ya.make b/contrib/restricted/boost/atomic/ya.make index c12564ebe8..eb77be5a43 100644 --- a/contrib/restricted/boost/atomic/ya.make +++ b/contrib/restricted/boost/atomic/ya.make @@ -6,9 +6,9 @@ LICENSE(BSL-1.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(1.82.0) +VERSION(1.83.0) -ORIGINAL_SOURCE(https://github.com/boostorg/atomic/archive/boost-1.82.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/atomic/archive/boost-1.83.0.tar.gz) PEERDIR( contrib/restricted/boost/align |