diff options
author | robot-contrib <[email protected]> | 2025-05-06 11:35:11 +0300 |
---|---|---|
committer | robot-contrib <[email protected]> | 2025-05-06 11:53:49 +0300 |
commit | eb9f7c3ff5a0712b5e711cb88e12f1dcb68ad612 (patch) | |
tree | 74a3329caeee0992ec5d2830ddcc9f0f12d09e0f | |
parent | d3153b6102d6495f4af17e5d35964a0b871f4542 (diff) |
Update contrib/restricted/boost/array to 1.88.0
commit_hash:0175a76a95ef74c349448549cc756046f4ebec70
7 files changed, 263 insertions, 183 deletions
diff --git a/contrib/restricted/boost/algorithm/include/boost/algorithm/searching/boyer_moore.hpp b/contrib/restricted/boost/algorithm/include/boost/algorithm/searching/boyer_moore.hpp index 80a5a4474d9..e3c00105c6b 100644 --- a/contrib/restricted/boost/algorithm/include/boost/algorithm/searching/boyer_moore.hpp +++ b/contrib/restricted/boost/algorithm/include/boost/algorithm/searching/boyer_moore.hpp @@ -10,6 +10,7 @@ #ifndef BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP #define BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP +#include <algorithm> // for std::reverse_copy #include <iterator> // for std::iterator_traits #include <boost/config.hpp> diff --git a/contrib/restricted/boost/algorithm/patches/pr124-add-missing-include.patch b/contrib/restricted/boost/algorithm/patches/pr124-add-missing-include.patch new file mode 100644 index 00000000000..b651dab0989 --- /dev/null +++ b/contrib/restricted/boost/algorithm/patches/pr124-add-missing-include.patch @@ -0,0 +1,21 @@ +From 7012619c8056b1b30f88bc57dd39c80c0018214f Mon Sep 17 00:00:00 2001 +From: Yuriy Chernyshov <[email protected]> +Date: Mon, 5 May 2025 18:01:59 +0200 +Subject: [PATCH] Add missing include + +--- + include/boost/algorithm/searching/boyer_moore.hpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/boost/algorithm/searching/boyer_moore.hpp b/include/boost/algorithm/searching/boyer_moore.hpp +index 80a5a4474..e3c00105c 100644 +--- a/include/boost/algorithm/searching/boyer_moore.hpp ++++ b/include/boost/algorithm/searching/boyer_moore.hpp +@@ -10,6 +10,7 @@ + #ifndef BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP + #define BOOST_ALGORITHM_BOYER_MOORE_SEARCH_HPP + ++#include <algorithm> // for std::reverse_copy + #include <iterator> // for std::iterator_traits + + #include <boost/config.hpp> diff --git a/contrib/restricted/boost/array/.yandex_meta/default.nix b/contrib/restricted/boost/array/.yandex_meta/default.nix index 31d056ef971..a627002ef7a 100644 --- a/contrib/restricted/boost/array/.yandex_meta/default.nix +++ b/contrib/restricted/boost/array/.yandex_meta/default.nix @@ -1,13 +1,13 @@ self: super: with self; { boost_array = stdenv.mkDerivation rec { pname = "boost_array"; - version = "1.87.0"; + version = "1.88.0"; src = fetchFromGitHub { owner = "boostorg"; repo = "array"; rev = "boost-${version}"; - hash = "sha256-KlUpm9POv39C7BBpC2foHzTUCE9t2uEEka9kMdRVgcA="; + hash = "sha256-P7pFHRtIkmDxWv3Oq5xul5l2eh2zX6rAr6/24pk/daY="; }; }; } diff --git a/contrib/restricted/boost/array/.yandex_meta/devtools.copyrights.report b/contrib/restricted/boost/array/.yandex_meta/devtools.copyrights.report index 74ba3a85c53..3b242c7aace 100644 --- a/contrib/restricted/boost/array/.yandex_meta/devtools.copyrights.report +++ b/contrib/restricted/boost/array/.yandex_meta/devtools.copyrights.report @@ -42,4 +42,4 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - include/boost/array.hpp [10:10] + include/boost/array.hpp [13:13] diff --git a/contrib/restricted/boost/array/.yandex_meta/devtools.licenses.report b/contrib/restricted/boost/array/.yandex_meta/devtools.licenses.report index 2c6ffdea8bd..5ed4f38a7b0 100644 --- a/contrib/restricted/boost/array/.yandex_meta/devtools.licenses.report +++ b/contrib/restricted/boost/array/.yandex_meta/devtools.licenses.report @@ -45,4 +45,4 @@ BELONGS ya.make Match type : NOTICE Links : http://www.boost.org/LICENSE_1_0.txt, http://www.boost.org/users/license.html, https://spdx.org/licenses/BSL-1.0 Files with this license: - include/boost/array.hpp [12:14] + include/boost/array.hpp [15:17] diff --git a/contrib/restricted/boost/array/include/boost/array.hpp b/contrib/restricted/boost/array/include/boost/array.hpp index 02bd76db755..bea6f9819ac 100644 --- a/contrib/restricted/boost/array/include/boost/array.hpp +++ b/contrib/restricted/boost/array/include/boost/array.hpp @@ -1,3 +1,6 @@ +#ifndef BOOST_ARRAY_HPP_INCLUDED +#define BOOST_ARRAY_HPP_INCLUDED + /* The following code declares class array, * an STL container (as wrapper) for arrays of constant size. * @@ -28,31 +31,31 @@ * * Jan 29, 2004 */ -#ifndef BOOST_ARRAY_HPP -#define BOOST_ARRAY_HPP -#include <boost/detail/workaround.hpp> +#include <boost/config.hpp> +#include <boost/config/workaround.hpp> #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) # pragma warning(push) -# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe -# pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated -# pragma warning(disable:4610) // warning C4610: class 'boost::array<T,N>' can never be instantiated - user defined constructor required +# pragma warning(disable: 4510) // boost::array<T,N>' : default constructor could not be generated +# pragma warning(disable: 4512) // boost::array<T,N>' : assignment operator could not be generated +# pragma warning(disable: 4610) // class 'boost::array<T,N>' can never be instantiated - user defined constructor required +# pragma warning(disable: 4702) // unreachable code #endif -#include <cstddef> -#include <iterator> -#include <stdexcept> #include <boost/assert.hpp> -#include <boost/core/invoke_swap.hpp> #include <boost/static_assert.hpp> - #include <boost/throw_exception.hpp> -#include <algorithm> - -// FIXES for broken compilers -#include <boost/config.hpp> +#include <iterator> +#include <stdexcept> +#include <utility> +#include <cstddef> +#if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L +# if __has_include(<compare>) +# include <compare> +# endif +#endif namespace boost { @@ -72,62 +75,54 @@ namespace boost { typedef std::ptrdiff_t difference_type; // iterator support - iterator begin() { return elems; } - const_iterator begin() const { return elems; } - const_iterator cbegin() const { return elems; } + BOOST_CXX14_CONSTEXPR iterator begin() BOOST_NOEXCEPT { return elems; } + BOOST_CONSTEXPR const_iterator begin() const BOOST_NOEXCEPT { return elems; } + BOOST_CONSTEXPR const_iterator cbegin() const BOOST_NOEXCEPT { return elems; } - iterator end() { return elems+N; } - const_iterator end() const { return elems+N; } - const_iterator cend() const { return elems+N; } + BOOST_CXX14_CONSTEXPR iterator end() BOOST_NOEXCEPT { return elems+N; } + BOOST_CONSTEXPR const_iterator end() const BOOST_NOEXCEPT { return elems+N; } + BOOST_CONSTEXPR const_iterator cend() const BOOST_NOEXCEPT { return elems+N; } // reverse iterator support -#if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) typedef std::reverse_iterator<iterator> reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator; -#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) - typedef std::reverse_iterator<iterator, std::random_access_iterator_tag, - value_type, reference, iterator, difference_type> reverse_iterator; - typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag, - value_type, const_reference, const_iterator, difference_type> const_reverse_iterator; -#else - // workaround for broken reverse_iterator implementations - typedef std::reverse_iterator<iterator,T> reverse_iterator; - typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator; -#endif - reverse_iterator rbegin() { return reverse_iterator(end()); } - const_reverse_iterator rbegin() const { + reverse_iterator rbegin() BOOST_NOEXCEPT { return reverse_iterator(end()); } + const_reverse_iterator rbegin() const BOOST_NOEXCEPT { return const_reverse_iterator(end()); } - const_reverse_iterator crbegin() const { + const_reverse_iterator crbegin() const BOOST_NOEXCEPT { return const_reverse_iterator(end()); } - reverse_iterator rend() { return reverse_iterator(begin()); } - const_reverse_iterator rend() const { + reverse_iterator rend() BOOST_NOEXCEPT { return reverse_iterator(begin()); } + const_reverse_iterator rend() const BOOST_NOEXCEPT { return const_reverse_iterator(begin()); } - const_reverse_iterator crend() const { + const_reverse_iterator crend() const BOOST_NOEXCEPT { return const_reverse_iterator(begin()); } // operator[] - reference operator[](size_type i) + BOOST_CXX14_CONSTEXPR reference operator[](size_type i) { return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i]; } - /*BOOST_CONSTEXPR*/ const_reference operator[](size_type i) const +#if !BOOST_WORKAROUND(BOOST_GCC, < 50000) + BOOST_CONSTEXPR +#endif + const_reference operator[](size_type i) const { return BOOST_ASSERT_MSG( i < N, "out of range" ), elems[i]; } // at() with range check - reference at(size_type i) { return rangecheck(i), elems[i]; } - /*BOOST_CONSTEXPR*/ const_reference at(size_type i) const { return rangecheck(i), elems[i]; } + BOOST_CXX14_CONSTEXPR reference at(size_type i) { return rangecheck(i), elems[i]; } + BOOST_CONSTEXPR const_reference at(size_type i) const { return rangecheck(i), elems[i]; } // front() and back() - reference front() + BOOST_CXX14_CONSTEXPR reference front() { return elems[0]; } @@ -137,7 +132,7 @@ namespace boost { return elems[0]; } - reference back() + BOOST_CXX14_CONSTEXPR reference back() { return elems[N-1]; } @@ -148,38 +143,56 @@ namespace boost { } // size is constant - static BOOST_CONSTEXPR size_type size() { return N; } - static BOOST_CONSTEXPR bool empty() { return false; } - static BOOST_CONSTEXPR size_type max_size() { return N; } + static BOOST_CONSTEXPR size_type size() BOOST_NOEXCEPT { return N; } + static BOOST_CONSTEXPR bool empty() BOOST_NOEXCEPT { return false; } + static BOOST_CONSTEXPR size_type max_size() BOOST_NOEXCEPT { return N; } enum { static_size = N }; // swap (note: linear complexity) - void swap (array<T,N>& y) { - for (size_type i = 0; i < N; ++i) - boost::core::invoke_swap(elems[i],y.elems[i]); + BOOST_CXX14_CONSTEXPR void swap (array<T,N>& y) + { + std::swap( elems, y.elems ); } - // direct access to data (read-only) - const T* data() const { return elems; } - T* data() { return elems; } + // direct access to data + BOOST_CONSTEXPR const T* data() const BOOST_NOEXCEPT { return elems; } + BOOST_CXX14_CONSTEXPR T* data() BOOST_NOEXCEPT { return elems; } - // use array as C array (direct read/write access to data) - T* c_array() { return elems; } + // obsolete + BOOST_DEPRECATED( "please use `data()` instead" ) + T* c_array() BOOST_NOEXCEPT { return elems; } // assignment with type conversion template <typename T2> - array<T,N>& operator= (const array<T2,N>& rhs) { - std::copy(rhs.begin(),rhs.end(), begin()); + array<T,N>& operator= (const array<T2,N>& rhs) + { + for( std::size_t i = 0; i < N; ++i ) + { + elems[ i ] = rhs.elems[ i ]; + } + return *this; } - // assign one value to all elements - void assign (const T& value) { fill ( value ); } // A synonym for fill - void fill (const T& value) + // fill with one value + BOOST_CXX14_CONSTEXPR void fill (const T& value) { - std::fill_n(begin(),size(),value); + // using elems[ 0 ] as a temporary copy + // avoids the aliasing opportunity betw. + // `value` and `elems` + + elems[ 0 ] = value; + + for( std::size_t i = 1; i < N; ++i ) + { + elems[ i ] = elems[ 0 ]; + } } + // an obsolete synonym for fill + BOOST_DEPRECATED( "please use `fill` instead" ) + void assign (const T& value) { fill ( value ); } + // check range (may be private because it is static) static BOOST_CONSTEXPR bool rangecheck (size_type i) { return i >= size() ? boost::throw_exception(std::out_of_range ("array<>: index out of range")), true : true; @@ -189,6 +202,8 @@ namespace boost { template< class T > class array< T, 0 > { + public: + struct {} elems; // enables initialization with = {{}} public: // type definitions @@ -201,42 +216,31 @@ namespace boost { typedef std::ptrdiff_t difference_type; // iterator support - iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); } - const_iterator begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); } - const_iterator cbegin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); } + BOOST_CXX14_CONSTEXPR iterator begin() BOOST_NOEXCEPT { return data(); } + BOOST_CONSTEXPR const_iterator begin() const BOOST_NOEXCEPT { return data(); } + BOOST_CONSTEXPR const_iterator cbegin() const BOOST_NOEXCEPT { return data(); } - iterator end() { return begin(); } - const_iterator end() const { return begin(); } - const_iterator cend() const { return cbegin(); } + BOOST_CXX14_CONSTEXPR iterator end() BOOST_NOEXCEPT { return begin(); } + BOOST_CONSTEXPR const_iterator end() const BOOST_NOEXCEPT { return begin(); } + BOOST_CONSTEXPR const_iterator cend() const BOOST_NOEXCEPT { return cbegin(); } // reverse iterator support -#if !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) typedef std::reverse_iterator<iterator> reverse_iterator; typedef std::reverse_iterator<const_iterator> const_reverse_iterator; -#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) - typedef std::reverse_iterator<iterator, std::random_access_iterator_tag, - value_type, reference, iterator, difference_type> reverse_iterator; - typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag, - value_type, const_reference, const_iterator, difference_type> const_reverse_iterator; -#else - // workaround for broken reverse_iterator implementations - typedef std::reverse_iterator<iterator,T> reverse_iterator; - typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator; -#endif - reverse_iterator rbegin() { return reverse_iterator(end()); } - const_reverse_iterator rbegin() const { + reverse_iterator rbegin() BOOST_NOEXCEPT { return reverse_iterator(end()); } + const_reverse_iterator rbegin() const BOOST_NOEXCEPT { return const_reverse_iterator(end()); } - const_reverse_iterator crbegin() const { + const_reverse_iterator crbegin() const BOOST_NOEXCEPT { return const_reverse_iterator(end()); } - reverse_iterator rend() { return reverse_iterator(begin()); } - const_reverse_iterator rend() const { + reverse_iterator rend() BOOST_NOEXCEPT { return reverse_iterator(begin()); } + const_reverse_iterator rend() const BOOST_NOEXCEPT { return const_reverse_iterator(begin()); } - const_reverse_iterator crend() const { + const_reverse_iterator crend() const BOOST_NOEXCEPT { return const_reverse_iterator(begin()); } @@ -246,14 +250,14 @@ namespace boost { return failed_rangecheck(); } - /*BOOST_CONSTEXPR*/ const_reference operator[](size_type /*i*/) const + const_reference operator[](size_type /*i*/) const { return failed_rangecheck(); } // at() with range check - reference at(size_type /*i*/) { return failed_rangecheck(); } - /*BOOST_CONSTEXPR*/ const_reference at(size_type /*i*/) const { return failed_rangecheck(); } + reference at(size_type /*i*/) { return failed_rangecheck(); } + const_reference at(size_type /*i*/) const { return failed_rangecheck(); } // front() and back() reference front() @@ -261,7 +265,7 @@ namespace boost { return failed_rangecheck(); } - BOOST_CONSTEXPR const_reference front() const + const_reference front() const { return failed_rangecheck(); } @@ -271,26 +275,28 @@ namespace boost { return failed_rangecheck(); } - BOOST_CONSTEXPR const_reference back() const + const_reference back() const { return failed_rangecheck(); } // size is constant - static BOOST_CONSTEXPR size_type size() { return 0; } - static BOOST_CONSTEXPR bool empty() { return true; } - static BOOST_CONSTEXPR size_type max_size() { return 0; } + static BOOST_CONSTEXPR size_type size() BOOST_NOEXCEPT { return 0; } + static BOOST_CONSTEXPR bool empty() BOOST_NOEXCEPT { return true; } + static BOOST_CONSTEXPR size_type max_size() BOOST_NOEXCEPT { return 0; } enum { static_size = 0 }; - void swap (array<T,0>& /*y*/) { + BOOST_CXX14_CONSTEXPR void swap (array<T,0>& /*y*/) + { } - // direct access to data (read-only) - const T* data() const { return 0; } - T* data() { return 0; } + // direct access to data + BOOST_CONSTEXPR const T* data() const BOOST_NOEXCEPT { return 0; } + BOOST_CXX14_CONSTEXPR T* data() BOOST_NOEXCEPT { return 0; } - // use array as C array (direct read/write access to data) - T* c_array() { return 0; } + // obsolete + BOOST_DEPRECATED( "please use `data()` instead" ) + T* c_array() BOOST_NOEXCEPT { return 0; } // assignment with type conversion template <typename T2> @@ -298,87 +304,119 @@ namespace boost { return *this; } - // assign one value to all elements + // an obsolete synonym for fill + BOOST_DEPRECATED( "please use `fill` instead" ) void assign (const T& value) { fill ( value ); } - void fill (const T& ) {} + + // fill with one value + BOOST_CXX14_CONSTEXPR void fill (const T& ) {} // check range (may be private because it is static) - static reference failed_rangecheck () { - std::out_of_range e("attempt to access element of an empty array"); - boost::throw_exception(e); -#if defined(BOOST_NO_EXCEPTIONS) || (!defined(BOOST_MSVC) && !defined(__PATHSCALE__)) - // - // We need to return something here to keep - // some compilers happy: however we will never - // actually get here.... - // - static T placeholder; - return placeholder; -#endif - } + static reference failed_rangecheck () + { + boost::throw_exception( std::out_of_range( "attempt to access element of an empty array" ) ); + } }; // comparisons template<class T, std::size_t N> - bool operator== (const array<T,N>& x, const array<T,N>& y) { - return std::equal(x.begin(), x.end(), y.begin()); + BOOST_CXX14_CONSTEXPR bool operator== (const array<T,N>& x, const array<T,N>& y) + { + for( std::size_t i = 0; i < N; ++i ) + { + if( !( x[ i ] == y[ i ] ) ) return false; + } + + return true; } - template<class T, std::size_t N> - bool operator< (const array<T,N>& x, const array<T,N>& y) { - return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end()); + +#if BOOST_WORKAROUND(BOOST_GCC, < 90000) + + template<class T> + BOOST_CXX14_CONSTEXPR bool operator== (const array<T, 0>& /*x*/, const array<T, 0>& /*y*/) + { + return true; } + +#endif + template<class T, std::size_t N> - bool operator!= (const array<T,N>& x, const array<T,N>& y) { + BOOST_CXX14_CONSTEXPR bool operator!= (const array<T,N>& x, const array<T,N>& y) { return !(x==y); } + + template<class T, std::size_t N> + BOOST_CXX14_CONSTEXPR bool operator< (const array<T,N>& x, const array<T,N>& y) + { + for( std::size_t i = 0; i < N; ++i ) + { + if( x[ i ] < y[ i ] ) return true; + if( y[ i ] < x[ i ] ) return false; + } + + return false; + } + +#if BOOST_WORKAROUND(BOOST_GCC, < 90000) + + template<class T> + BOOST_CXX14_CONSTEXPR bool operator< (const array<T, 0>& /*x*/, const array<T, 0>& /*y*/) + { + return false; + } + +#endif + template<class T, std::size_t N> - bool operator> (const array<T,N>& x, const array<T,N>& y) { + BOOST_CXX14_CONSTEXPR bool operator> (const array<T,N>& x, const array<T,N>& y) { return y<x; } + template<class T, std::size_t N> - bool operator<= (const array<T,N>& x, const array<T,N>& y) { + BOOST_CXX14_CONSTEXPR bool operator<= (const array<T,N>& x, const array<T,N>& y) { return !(y<x); } + template<class T, std::size_t N> - bool operator>= (const array<T,N>& x, const array<T,N>& y) { + BOOST_CXX14_CONSTEXPR bool operator>= (const array<T,N>& x, const array<T,N>& y) { return !(x<y); } // global swap() template<class T, std::size_t N> - inline void swap (array<T,N>& x, array<T,N>& y) { + BOOST_CXX14_CONSTEXPR inline void swap (array<T,N>& x, array<T,N>& y) { x.swap(y); } -#if defined(__SUNPRO_CC) -// Trac ticket #4757; the Sun Solaris compiler can't handle -// syntax like 'T(&get_c_array(boost::array<T,N>& arg))[N]' -// -// We can't just use this for all compilers, because the -// borland compilers can't handle this form. - namespace detail { - template <typename T, std::size_t N> struct c_array - { - typedef T type[N]; - }; +#if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L +# if __has_include(<compare>) + + template<class T, std::size_t N> + constexpr auto operator<=> (const array<T,N>& x, const array<T,N>& y) + -> decltype( x.elems[ 0 ] <=> y.elems[ 0 ] ) + { + for( std::size_t i = 0; i < N; ++i ) + { + auto r = x.elems[ i ] <=> y.elems[ i ]; + if( r != 0 ) return r; + } + + return std::strong_ordering::equal; + } + + template<class T> + constexpr auto operator<=> (const array<T,0>& /*x*/, const array<T,0>& /*y*/) + -> std::strong_ordering + { + return std::strong_ordering::equal; } - // Specific for boost::array: simply returns its elems data member. - template <typename T, std::size_t N> - typename detail::c_array<T,N>::type& get_c_array(boost::array<T,N>& arg) - { - return arg.elems; - } - - // Specific for boost::array: simply returns its elems data member. - template <typename T, std::size_t N> - typename detail::c_array<T,N>::type const& get_c_array(const boost::array<T,N>& arg) - { - return arg.elems; - } -#else -// Specific for boost::array: simply returns its elems data member. +# endif +#endif + + // undocumented and obsolete template <typename T, std::size_t N> + BOOST_DEPRECATED( "please use `elems` instead" ) T(&get_c_array(boost::array<T,N>& arg))[N] { return arg.elems; @@ -386,49 +424,68 @@ namespace boost { // Const version. template <typename T, std::size_t N> + BOOST_DEPRECATED( "please use `elems` instead" ) const T(&get_c_array(const boost::array<T,N>& arg))[N] { return arg.elems; } -#endif -#if 0 - // Overload for std::array, assuming that std::array will have - // explicit conversion functions as discussed at the WG21 meeting - // in Summit, March 2009. - template <typename T, std::size_t N> - T(&get_c_array(std::array<T,N>& arg))[N] + template <size_t Idx, typename T, size_t N> + BOOST_CXX14_CONSTEXPR T &get(boost::array<T,N> &arr) BOOST_NOEXCEPT { - return static_cast<T(&)[N]>(arg); + BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(boost::array &) index out of range" ); + return arr[Idx]; } - // Const version. - template <typename T, std::size_t N> - const T(&get_c_array(const std::array<T,N>& arg))[N] + template <size_t Idx, typename T, size_t N> + BOOST_CONSTEXPR const T &get(const boost::array<T,N> &arr) BOOST_NOEXCEPT { - return static_cast<T(&)[N]>(arg); + BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(const boost::array &) index out of range" ); + return arr[Idx]; } -#endif - template <class It> std::size_t hash_range(It, It); + template<class T, std::size_t N> + BOOST_CXX14_CONSTEXPR array<T, N> to_array( T const (&a)[ N ] ) + { + array<T, N> r = {}; + + for( std::size_t i = 0; i < N; ++i ) + { + r[ i ] = a[ i ]; + } + + return r; + } + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template<class T, std::size_t N> - std::size_t hash_value(const array<T,N>& arr) + BOOST_CXX14_CONSTEXPR array<T, N> to_array( T (&&a)[ N ] ) { - return boost::hash_range(arr.begin(), arr.end()); + array<T, N> r = {}; + + for( std::size_t i = 0; i < N; ++i ) + { + r[ i ] = std::move( a[ i ] ); + } + + return r; } - template <size_t Idx, typename T, size_t N> - T &get(boost::array<T,N> &arr) BOOST_NOEXCEPT { - BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(boost::array &) index out of range" ); - return arr[Idx]; - } + template<class T, std::size_t N> + BOOST_CXX14_CONSTEXPR array<T, N> to_array( T const (&&a)[ N ] ) + { + array<T, N> r = {}; - template <size_t Idx, typename T, size_t N> - const T &get(const boost::array<T,N> &arr) BOOST_NOEXCEPT { - BOOST_STATIC_ASSERT_MSG ( Idx < N, "boost::get<>(const boost::array &) index out of range" ); - return arr[Idx]; - } + for( std::size_t i = 0; i < N; ++i ) + { + r[ i ] = a[ i ]; + } + + return r; + } + +#endif } /* namespace boost */ @@ -436,12 +493,14 @@ namespace boost { // If we don't have std::array, I'm assuming that we don't have std::get namespace std { template <size_t Idx, typename T, size_t N> + BOOST_DEPRECATED( "please use `boost::get` instead" ) T &get(boost::array<T,N> &arr) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(boost::array &) index out of range" ); return arr[Idx]; } template <size_t Idx, typename T, size_t N> + BOOST_DEPRECATED( "please use `boost::get` instead" ) const T &get(const boost::array<T,N> &arr) BOOST_NOEXCEPT { BOOST_STATIC_ASSERT_MSG ( Idx < N, "std::get<>(const boost::array &) index out of range" ); return arr[Idx]; @@ -453,4 +512,4 @@ namespace std { # pragma warning(pop) #endif -#endif /*BOOST_ARRAY_HPP*/ +#endif // #ifndef BOOST_ARRAY_HPP_INCLUDED diff --git a/contrib/restricted/boost/array/ya.make b/contrib/restricted/boost/array/ya.make index 36c56a138b4..f09d0a5b3ac 100644 --- a/contrib/restricted/boost/array/ya.make +++ b/contrib/restricted/boost/array/ya.make @@ -6,14 +6,13 @@ LICENSE(BSL-1.0) LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(1.87.0) +VERSION(1.88.0) -ORIGINAL_SOURCE(https://github.com/boostorg/array/archive/boost-1.87.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/array/archive/boost-1.88.0.tar.gz) PEERDIR( contrib/restricted/boost/assert contrib/restricted/boost/config - contrib/restricted/boost/core contrib/restricted/boost/static_assert contrib/restricted/boost/throw_exception ) |