diff options
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__split_buffer')
| -rw-r--r-- | contrib/llvm-project/libcxx/include/__split_buffer | 140 |
1 files changed, 69 insertions, 71 deletions
diff --git a/contrib/llvm-project/libcxx/include/__split_buffer b/contrib/llvm-project/libcxx/include/__split_buffer index 6854f6a4b2f8..07dedba5e801 100644 --- a/contrib/llvm-project/libcxx/include/__split_buffer +++ b/contrib/llvm-project/libcxx/include/__split_buffer @@ -160,15 +160,13 @@ public: _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n); _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __construct_at_end(size_type __n, const_reference __x); - template <class _InputIter> + template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> = 0> _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI - __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value> - __construct_at_end(_InputIter __first, _InputIter __last); + void __construct_at_end(_InputIter __first, _InputIter __last); - template <class _ForwardIterator> + template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> = 0> _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI - __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value> - __construct_at_end(_ForwardIterator __first, _ForwardIterator __last); + void __construct_at_end(_ForwardIterator __first, _ForwardIterator __last); template <class _Iterator, class _Sentinel> _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI @@ -200,7 +198,7 @@ public: private: _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer& __c, true_type) _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value) { - __alloc() = _VSTD::move(__c.__alloc()); + __alloc() = std::move(__c.__alloc()); } _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT {} @@ -260,7 +258,7 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n) { _ConstructTransaction __tx(&this->__end_, __n); for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) { - __alloc_traits::construct(this->__alloc(), _VSTD::__to_address(__tx.__pos_)); + __alloc_traits::construct(this->__alloc(), std::__to_address(__tx.__pos_)); } } @@ -278,14 +276,14 @@ __split_buffer<_Tp, _Allocator>::__construct_at_end(size_type __n, const_referen _ConstructTransaction __tx(&this->__end_, __n); for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_) { __alloc_traits::construct(this->__alloc(), - _VSTD::__to_address(__tx.__pos_), __x); + std::__to_address(__tx.__pos_), __x); } } template <class _Tp, class _Allocator> -template <class _InputIter> -_LIBCPP_CONSTEXPR_SINCE_CXX20 __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value> -__split_buffer<_Tp, _Allocator>::__construct_at_end(_InputIter __first, _InputIter __last) +template <class _InputIter, __enable_if_t<__has_exactly_input_iterator_category<_InputIter>::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 +void __split_buffer<_Tp, _Allocator>::__construct_at_end(_InputIter __first, _InputIter __last) { __construct_at_end_with_sentinel(__first, __last); } @@ -300,21 +298,21 @@ void __split_buffer<_Tp, _Allocator>::__construct_at_end_with_sentinel(_Iterator if (__end_ == __end_cap()) { size_type __old_cap = __end_cap() - __first_; - size_type __new_cap = _VSTD::max<size_type>(2 * __old_cap, 8); + size_type __new_cap = std::max<size_type>(2 * __old_cap, 8); __split_buffer __buf(__new_cap, 0, __a); for (pointer __p = __begin_; __p != __end_; ++__p, (void) ++__buf.__end_) __alloc_traits::construct(__buf.__alloc(), - _VSTD::__to_address(__buf.__end_), _VSTD::move(*__p)); + std::__to_address(__buf.__end_), std::move(*__p)); swap(__buf); } - __alloc_traits::construct(__a, _VSTD::__to_address(this->__end_), *__first); + __alloc_traits::construct(__a, std::__to_address(this->__end_), *__first); ++this->__end_; } } template <class _Tp, class _Allocator> -template <class _ForwardIterator> -_LIBCPP_CONSTEXPR_SINCE_CXX20 __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value> -__split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last) +template <class _ForwardIterator, __enable_if_t<__has_forward_iterator_category<_ForwardIterator>::value, int> > +_LIBCPP_CONSTEXPR_SINCE_CXX20 +void __split_buffer<_Tp, _Allocator>::__construct_at_end(_ForwardIterator __first, _ForwardIterator __last) { __construct_at_end_with_size(__first, std::distance(__first, __last)); } @@ -326,7 +324,7 @@ void __split_buffer<_Tp, _Allocator>::__construct_at_end_with_size(_ForwardItera _ConstructTransaction __tx(&this->__end_, __n); for (; __tx.__pos_ != __tx.__end_; ++__tx.__pos_, (void) ++__first) { __alloc_traits::construct(this->__alloc(), - _VSTD::__to_address(__tx.__pos_), *__first); + std::__to_address(__tx.__pos_), *__first); } } @@ -337,7 +335,7 @@ void __split_buffer<_Tp, _Allocator>::__destruct_at_begin(pointer __new_begin, false_type) { while (__begin_ != __new_begin) - __alloc_traits::destroy(__alloc(), _VSTD::__to_address(__begin_++)); + __alloc_traits::destroy(__alloc(), std::__to_address(__begin_++)); } template <class _Tp, class _Allocator> @@ -356,7 +354,7 @@ void __split_buffer<_Tp, _Allocator>::__destruct_at_end(pointer __new_last, false_type) _NOEXCEPT { while (__new_last != __end_) - __alloc_traits::destroy(__alloc(), _VSTD::__to_address(--__end_)); + __alloc_traits::destroy(__alloc(), std::__to_address(--__end_)); } template <class _Tp, class _Allocator> @@ -397,10 +395,10 @@ template <class _Tp, class _Allocator> _LIBCPP_CONSTEXPR_SINCE_CXX20 __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c) _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value) - : __first_(_VSTD::move(__c.__first_)), - __begin_(_VSTD::move(__c.__begin_)), - __end_(_VSTD::move(__c.__end_)), - __end_cap_(_VSTD::move(__c.__end_cap_)) + : __first_(std::move(__c.__first_)), + __begin_(std::move(__c.__begin_)), + __end_(std::move(__c.__end_)), + __end_cap_(std::move(__c.__end_cap_)) { __c.__first_ = nullptr; __c.__begin_ = nullptr; @@ -463,11 +461,11 @@ __split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x) _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value|| __is_nothrow_swappable<__alloc_rr>::value) { - _VSTD::swap(__first_, __x.__first_); - _VSTD::swap(__begin_, __x.__begin_); - _VSTD::swap(__end_, __x.__end_); - _VSTD::swap(__end_cap(), __x.__end_cap()); - _VSTD::__swap_allocator(__alloc(), __x.__alloc()); + std::swap(__first_, __x.__first_); + std::swap(__begin_, __x.__begin_); + std::swap(__end_, __x.__end_); + std::swap(__end_cap(), __x.__end_cap()); + std::__swap_allocator(__alloc(), __x.__alloc()); } template <class _Tp, class _Allocator> @@ -480,10 +478,10 @@ __split_buffer<_Tp, _Allocator>::reserve(size_type __n) __split_buffer<value_type, __alloc_rr&> __t(__n, 0, __alloc()); __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_)); - _VSTD::swap(__first_, __t.__first_); - _VSTD::swap(__begin_, __t.__begin_); - _VSTD::swap(__end_, __t.__end_); - _VSTD::swap(__end_cap(), __t.__end_cap()); + std::swap(__first_, __t.__first_); + std::swap(__begin_, __t.__begin_); + std::swap(__end_, __t.__end_); + std::swap(__end_cap(), __t.__end_cap()); } } @@ -502,10 +500,10 @@ __split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_)); __t.__end_ = __t.__begin_ + (__end_ - __begin_); - _VSTD::swap(__first_, __t.__first_); - _VSTD::swap(__begin_, __t.__begin_); - _VSTD::swap(__end_, __t.__end_); - _VSTD::swap(__end_cap(), __t.__end_cap()); + std::swap(__first_, __t.__first_); + std::swap(__begin_, __t.__begin_); + std::swap(__end_, __t.__end_); + std::swap(__end_cap(), __t.__end_cap()); #ifndef _LIBCPP_HAS_NO_EXCEPTIONS } catch (...) @@ -526,7 +524,7 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x) { difference_type __d = __end_cap() - __end_; __d = (__d + 1) / 2; - __begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d); + __begin_ = std::move_backward(__begin_, __end_, __end_ + __d); __end_ += __d; } else @@ -535,13 +533,13 @@ __split_buffer<_Tp, _Allocator>::push_front(const_reference __x) __split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc()); __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_)); - _VSTD::swap(__first_, __t.__first_); - _VSTD::swap(__begin_, __t.__begin_); - _VSTD::swap(__end_, __t.__end_); - _VSTD::swap(__end_cap(), __t.__end_cap()); + std::swap(__first_, __t.__first_); + std::swap(__begin_, __t.__begin_); + std::swap(__end_, __t.__end_); + std::swap(__end_cap(), __t.__end_cap()); } } - __alloc_traits::construct(__alloc(), _VSTD::__to_address(__begin_-1), __x); + __alloc_traits::construct(__alloc(), std::__to_address(__begin_-1), __x); --__begin_; } @@ -556,7 +554,7 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x) { difference_type __d = __end_cap() - __end_; __d = (__d + 1) / 2; - __begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d); + __begin_ = std::move_backward(__begin_, __end_, __end_ + __d); __end_ += __d; } else @@ -565,14 +563,14 @@ __split_buffer<_Tp, _Allocator>::push_front(value_type&& __x) __split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc()); __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_)); - _VSTD::swap(__first_, __t.__first_); - _VSTD::swap(__begin_, __t.__begin_); - _VSTD::swap(__end_, __t.__end_); - _VSTD::swap(__end_cap(), __t.__end_cap()); + std::swap(__first_, __t.__first_); + std::swap(__begin_, __t.__begin_); + std::swap(__end_, __t.__end_); + std::swap(__end_cap(), __t.__end_cap()); } } - __alloc_traits::construct(__alloc(), _VSTD::__to_address(__begin_-1), - _VSTD::move(__x)); + __alloc_traits::construct(__alloc(), std::__to_address(__begin_-1), + std::move(__x)); --__begin_; } @@ -588,7 +586,7 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x) { difference_type __d = __begin_ - __first_; __d = (__d + 1) / 2; - __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d); + __end_ = std::move(__begin_, __end_, __begin_ - __d); __begin_ -= __d; } else @@ -597,13 +595,13 @@ __split_buffer<_Tp, _Allocator>::push_back(const_reference __x) __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc()); __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_)); - _VSTD::swap(__first_, __t.__first_); - _VSTD::swap(__begin_, __t.__begin_); - _VSTD::swap(__end_, __t.__end_); - _VSTD::swap(__end_cap(), __t.__end_cap()); + std::swap(__first_, __t.__first_); + std::swap(__begin_, __t.__begin_); + std::swap(__end_, __t.__end_); + std::swap(__end_cap(), __t.__end_cap()); } } - __alloc_traits::construct(__alloc(), _VSTD::__to_address(__end_), __x); + __alloc_traits::construct(__alloc(), std::__to_address(__end_), __x); ++__end_; } @@ -618,7 +616,7 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x) { difference_type __d = __begin_ - __first_; __d = (__d + 1) / 2; - __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d); + __end_ = std::move(__begin_, __end_, __begin_ - __d); __begin_ -= __d; } else @@ -627,14 +625,14 @@ __split_buffer<_Tp, _Allocator>::push_back(value_type&& __x) __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc()); __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_)); - _VSTD::swap(__first_, __t.__first_); - _VSTD::swap(__begin_, __t.__begin_); - _VSTD::swap(__end_, __t.__end_); - _VSTD::swap(__end_cap(), __t.__end_cap()); + std::swap(__first_, __t.__first_); + std::swap(__begin_, __t.__begin_); + std::swap(__end_, __t.__end_); + std::swap(__end_cap(), __t.__end_cap()); } } - __alloc_traits::construct(__alloc(), _VSTD::__to_address(__end_), - _VSTD::move(__x)); + __alloc_traits::construct(__alloc(), std::__to_address(__end_), + std::move(__x)); ++__end_; } @@ -650,7 +648,7 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args) { difference_type __d = __begin_ - __first_; __d = (__d + 1) / 2; - __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d); + __end_ = std::move(__begin_, __end_, __begin_ - __d); __begin_ -= __d; } else @@ -659,14 +657,14 @@ __split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args) __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc()); __t.__construct_at_end(move_iterator<pointer>(__begin_), move_iterator<pointer>(__end_)); - _VSTD::swap(__first_, __t.__first_); - _VSTD::swap(__begin_, __t.__begin_); - _VSTD::swap(__end_, __t.__end_); - _VSTD::swap(__end_cap(), __t.__end_cap()); + std::swap(__first_, __t.__first_); + std::swap(__begin_, __t.__begin_); + std::swap(__end_, __t.__end_); + std::swap(__end_cap(), __t.__end_cap()); } } - __alloc_traits::construct(__alloc(), _VSTD::__to_address(__end_), - _VSTD::forward<_Args>(__args)...); + __alloc_traits::construct(__alloc(), std::__to_address(__end_), + std::forward<_Args>(__args)...); ++__end_; } |
