diff options
author | robot-contrib <[email protected]> | 2023-08-15 07:43:10 +0300 |
---|---|---|
committer | robot-contrib <[email protected]> | 2023-08-15 12:35:48 +0300 |
commit | 240297ad4e5a60c5cc2caabb4325b2213ad3a6e5 (patch) | |
tree | d9f9924883f5621c6885b1292de03f1b5c480273 /contrib | |
parent | 2319a0bb52b6d748c10fdc0f4b2f6656a0c04c51 (diff) |
Update contrib/restricted/boost/iterator to 1.83.0
Diffstat (limited to 'contrib')
6 files changed, 179 insertions, 63 deletions
diff --git a/contrib/restricted/boost/iterator/include/boost/iterator/detail/facade_iterator_category.hpp b/contrib/restricted/boost/iterator/include/boost/iterator/detail/facade_iterator_category.hpp index 6db45e45392..9d41320f628 100644 --- a/contrib/restricted/boost/iterator/include/boost/iterator/detail/facade_iterator_category.hpp +++ b/contrib/restricted/boost/iterator/include/boost/iterator/detail/facade_iterator_category.hpp @@ -13,15 +13,14 @@ # include <boost/mpl/if.hpp> # include <boost/mpl/eval_if.hpp> # include <boost/mpl/identity.hpp> -# include <boost/mpl/assert.hpp> + +# include <boost/static_assert.hpp> # include <boost/type_traits/is_same.hpp> # include <boost/type_traits/is_const.hpp> # include <boost/type_traits/is_reference.hpp> # include <boost/type_traits/is_convertible.hpp> -# include <boost/type_traits/is_same.hpp> - # include <boost/iterator/detail/config_def.hpp> // try to keep this last # ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY @@ -139,17 +138,17 @@ struct iterator_category_with_traversal // Make sure this isn't used to build any categories where // convertibility to Traversal is redundant. Should just use the // Category element in that case. - BOOST_MPL_ASSERT_NOT(( - is_convertible< + BOOST_STATIC_ASSERT(( + !is_convertible< typename iterator_category_to_traversal<Category>::type , Traversal - >)); + >::value)); - BOOST_MPL_ASSERT((is_iterator_category<Category>)); - BOOST_MPL_ASSERT_NOT((is_iterator_category<Traversal>)); - BOOST_MPL_ASSERT_NOT((is_iterator_traversal<Category>)); + BOOST_STATIC_ASSERT(is_iterator_category<Category>::value); + BOOST_STATIC_ASSERT(!is_iterator_category<Traversal>::value); + BOOST_STATIC_ASSERT(!is_iterator_traversal<Category>::value); # if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310)) - BOOST_MPL_ASSERT((is_iterator_traversal<Traversal>)); + BOOST_STATIC_ASSERT(is_iterator_traversal<Traversal>::value); # endif }; @@ -158,7 +157,7 @@ struct iterator_category_with_traversal template <class Traversal, class ValueParam, class Reference> struct facade_iterator_category_impl { - BOOST_MPL_ASSERT_NOT((is_iterator_category<Traversal>)); + BOOST_STATIC_ASSERT(!is_iterator_category<Traversal>::value); typedef typename iterator_facade_default_category< Traversal,ValueParam,Reference diff --git a/contrib/restricted/boost/iterator/include/boost/iterator/filter_iterator.hpp b/contrib/restricted/boost/iterator/include/boost/iterator/filter_iterator.hpp index b87c02b0aba..18c6186aa46 100644 --- a/contrib/restricted/boost/iterator/include/boost/iterator/filter_iterator.hpp +++ b/contrib/restricted/boost/iterator/include/boost/iterator/filter_iterator.hpp @@ -12,6 +12,14 @@ #include <boost/type_traits/is_class.hpp> #include <boost/static_assert.hpp> +#include <boost/config.hpp> +#include <boost/config/workaround.hpp> + +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES +#define BOOST_ITERATOR_DETAIL_MOVE(_type, _value) static_cast< _type&& >(_value) +#else +#define BOOST_ITERATOR_DETAIL_MOVE(_type, _value) _value +#endif namespace boost { namespace iterators { @@ -54,13 +62,13 @@ namespace iterators { filter_iterator() { } filter_iterator(Predicate f, Iterator x, Iterator end_ = Iterator()) - : super_t(x), m_predicate(f), m_end(end_) + : super_t(BOOST_ITERATOR_DETAIL_MOVE(Iterator, x)), m_predicate(BOOST_ITERATOR_DETAIL_MOVE(Predicate, f)), m_end(BOOST_ITERATOR_DETAIL_MOVE(Iterator, end_)) { satisfy_predicate(); } filter_iterator(Iterator x, Iterator end_ = Iterator()) - : super_t(x), m_predicate(), m_end(end_) + : super_t(BOOST_ITERATOR_DETAIL_MOVE(Iterator, x)), m_predicate(), m_end(BOOST_ITERATOR_DETAIL_MOVE(Iterator, end_)) { // Pro8 is a little too aggressive about instantiating the // body of this function. @@ -111,7 +119,7 @@ namespace iterators { inline filter_iterator<Predicate,Iterator> make_filter_iterator(Predicate f, Iterator x, Iterator end = Iterator()) { - return filter_iterator<Predicate,Iterator>(f,x,end); + return filter_iterator<Predicate,Iterator>(BOOST_ITERATOR_DETAIL_MOVE(Predicate, f), BOOST_ITERATOR_DETAIL_MOVE(Iterator, x), BOOST_ITERATOR_DETAIL_MOVE(Iterator, end)); } template <class Predicate, class Iterator> @@ -123,7 +131,7 @@ namespace iterators { >::type x , Iterator end = Iterator()) { - return filter_iterator<Predicate,Iterator>(x,end); + return filter_iterator<Predicate,Iterator>(BOOST_ITERATOR_DETAIL_MOVE(Iterator, x), BOOST_ITERATOR_DETAIL_MOVE(Iterator, end)); } } // namespace iterators @@ -133,4 +141,6 @@ using iterators::make_filter_iterator; } // namespace boost +#undef BOOST_ITERATOR_DETAIL_MOVE + #endif // BOOST_FILTER_ITERATOR_23022003THW_HPP diff --git a/contrib/restricted/boost/iterator/include/boost/iterator/is_iterator.hpp b/contrib/restricted/boost/iterator/include/boost/iterator/is_iterator.hpp new file mode 100644 index 00000000000..5740b19eb69 --- /dev/null +++ b/contrib/restricted/boost/iterator/include/boost/iterator/is_iterator.hpp @@ -0,0 +1,148 @@ +/* + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * https://www.boost.org/LICENSE_1_0.txt) + * + * Copyright (c) 2023 Andrey Semashev + */ +/*! + * \file iterator/is_iterator.hpp + * + * This header contains definition of the \c is_iterator type trait. + */ + +#ifndef BOOST_ITERATOR_IS_ITERATOR_HPP_INCLUDED_ +#define BOOST_ITERATOR_IS_ITERATOR_HPP_INCLUDED_ + +#include <cstddef> +#include <boost/config.hpp> +#include <boost/type_traits/integral_constant.hpp> +#include <boost/type_traits/negation.hpp> +#include <boost/type_traits/conjunction.hpp> +#include <boost/type_traits/is_complete.hpp> +#include <boost/type_traits/is_function.hpp> +#if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS) +#include <iterator> +#endif + +#ifdef BOOST_HAS_PRAGMA_ONCE +#pragma once +#endif + +namespace boost { +namespace iterators { +namespace detail { + +// The trait attempts to detect if the T type is an iterator class. Class-type iterators are assumed +// to have the nested type iterator_category. Strictly speaking, this is not required to be the +// case (e.g. a user can specialize iterator_traits for T without defining T::iterator_category). +// Still, this is a good heuristic in practice, and we can't do anything better anyway. +// Since C++17 we can test for iterator_traits<T>::iterator_category presence instead as it is +// required to be only present for iterators. +namespace has_iterator_category_detail { + +typedef char yes_type; +struct no_type { char padding[2]; }; + +template< typename T > +yes_type check( +#if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS) + typename std::iterator_traits< T >::iterator_category* +#else + typename T::iterator_category* +#endif +); +template< typename > +no_type check(...); + +} // namespace has_iterator_category_detail + +template< typename T > +struct is_iterator_impl : + public boost::integral_constant< + bool, + sizeof(has_iterator_category_detail::check< T >(0)) == sizeof(has_iterator_category_detail::yes_type) + > +{ +}; + +template< typename T > +struct is_iterator_impl< T* > : + public boost::conjunction< + boost::is_complete< T >, + boost::negation< boost::is_function< T > > + >::type +{ +}; + +template< typename T, typename U > +struct is_iterator_impl< T U::* > : + public boost::false_type +{ +}; + +template< typename T > +struct is_iterator_impl< T& > : + public boost::false_type +{ +}; + +template< typename T, std::size_t N > +struct is_iterator_impl< T[N] > : + public boost::false_type +{ +}; + +#if !defined(BOOST_TT_HAS_WORKING_IS_COMPLETE) +template< typename T > +struct is_iterator_impl< T[] > : + public boost::false_type +{ +}; + +template< > +struct is_iterator_impl< void > : + public boost::false_type +{ +}; + +template< > +struct is_iterator_impl< void* > : + public boost::false_type +{ +}; +#endif // !defined(BOOST_TT_HAS_WORKING_IS_COMPLETE) + +} // namespace detail + +/*! + * \brief The type trait detects whether the type \c T is an iterator type. + * + * The type trait yields \c true if its argument type \c T, after stripping top level + * cv qualifiers, is one of the following: + * + * - A pointer type, other than a pointer to function, a pointer to a class member, + * or a pointer to an incomplete type, including `void`. + * - A class type for which an iterator category is obtainable. Prior to C++17, + * the iterator category must be defined as a public `T::iterator_category` type. + * Since C++17, the expression `std::iterator_traits< T >::iterator_category` must + * be valid and produce the iterator category type. + * + * Otherwise, the type trait yields \c false. + */ +template< typename T > +struct is_iterator : public detail::is_iterator_impl< T >::type {}; +template< typename T > +struct is_iterator< const T > : public detail::is_iterator_impl< T >::type {}; +template< typename T > +struct is_iterator< volatile T > : public detail::is_iterator_impl< T >::type {}; +template< typename T > +struct is_iterator< const volatile T > : public detail::is_iterator_impl< T >::type {}; + +} // namespace iterators + +using iterators::is_iterator; + +} // namespace boost + +#endif // BOOST_ITERATOR_IS_ITERATOR_HPP_INCLUDED_ diff --git a/contrib/restricted/boost/iterator/include/boost/iterator/iterator_concepts.hpp b/contrib/restricted/boost/iterator/include/boost/iterator/iterator_concepts.hpp index 415cc496a02..3c65553e8ce 100644 --- a/contrib/restricted/boost/iterator/include/boost/iterator/iterator_concepts.hpp +++ b/contrib/restricted/boost/iterator/include/boost/iterator/iterator_concepts.hpp @@ -144,8 +144,8 @@ namespace boost_concepts { typedef typename std::iterator_traits<Iterator>::difference_type difference_type; - BOOST_MPL_ASSERT((boost::is_integral<difference_type>)); - BOOST_MPL_ASSERT_RELATION(std::numeric_limits<difference_type>::is_signed, ==, true); + BOOST_STATIC_ASSERT(boost::is_integral<difference_type>::value); + BOOST_STATIC_ASSERT(std::numeric_limits<difference_type>::is_signed); BOOST_CONCEPT_ASSERT(( boost::Convertible< diff --git a/contrib/restricted/boost/iterator/include/boost/next_prior.hpp b/contrib/restricted/boost/iterator/include/boost/next_prior.hpp index 5de705f591b..d943b97f608 100644 --- a/contrib/restricted/boost/iterator/include/boost/next_prior.hpp +++ b/contrib/restricted/boost/iterator/include/boost/next_prior.hpp @@ -15,13 +15,12 @@ #ifndef BOOST_NEXT_PRIOR_HPP_INCLUDED #define BOOST_NEXT_PRIOR_HPP_INCLUDED -#include <iterator> #include <boost/config.hpp> -#include <boost/core/enable_if.hpp> #include <boost/type_traits/has_plus.hpp> #include <boost/type_traits/has_plus_assign.hpp> #include <boost/type_traits/has_minus.hpp> #include <boost/type_traits/has_minus_assign.hpp> +#include <boost/iterator/is_iterator.hpp> #include <boost/iterator/advance.hpp> #include <boost/iterator/reverse_iterator.hpp> @@ -39,46 +38,6 @@ namespace boost { namespace next_prior_detail { -// The trait attempts to detect if the T type is an iterator. Class-type iterators are assumed -// to have the nested type iterator_category. Strictly speaking, this is not required to be the -// case (e.g. a user can specialize iterator_traits for T without defining T::iterator_category). -// Still, this is a good heuristic in practice, and we can't do anything better anyway. -// Since C++17 we can test for iterator_traits<T>::iterator_category presence instead as it is -// required to be only present for iterators. -template< typename T, typename Void = void > -struct is_iterator_class -{ - static BOOST_CONSTEXPR_OR_CONST bool value = false; -}; - -template< typename T > -struct is_iterator_class< - T, - typename enable_if_has_type< -#if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS) - typename std::iterator_traits< T >::iterator_category -#else - typename T::iterator_category -#endif - >::type -> -{ - static BOOST_CONSTEXPR_OR_CONST bool value = true; -}; - -template< typename T > -struct is_iterator : - public is_iterator_class< T > -{ -}; - -template< typename T > -struct is_iterator< T* > -{ - static BOOST_CONSTEXPR_OR_CONST bool value = true; -}; - - template< typename T, typename Distance, bool HasPlus = has_plus< T, Distance >::value > struct next_plus_impl; @@ -107,7 +66,7 @@ struct next_plus_assign_impl< T, Distance, true > } }; -template< typename T, typename Distance, bool IsIterator = is_iterator< T >::value > +template< typename T, typename Distance, bool IsIterator = boost::iterators::is_iterator< T >::value > struct next_advance_impl : public next_plus_assign_impl< T, Distance > { @@ -152,7 +111,7 @@ struct prior_minus_assign_impl< T, Distance, true > } }; -template< typename T, typename Distance, bool IsIterator = is_iterator< T >::value > +template< typename T, typename Distance, bool IsIterator = boost::iterators::is_iterator< T >::value > struct prior_advance_impl : public prior_minus_assign_impl< T, Distance > { diff --git a/contrib/restricted/boost/iterator/ya.make b/contrib/restricted/boost/iterator/ya.make index 52be178159c..c2b286a7d78 100644 --- a/contrib/restricted/boost/iterator/ya.make +++ b/contrib/restricted/boost/iterator/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/iterator/archive/boost-1.82.0.tar.gz) +ORIGINAL_SOURCE(https://github.com/boostorg/iterator/archive/boost-1.83.0.tar.gz) PEERDIR( contrib/restricted/boost/assert |