From bd680139d084b673d1f56d0e63e01936c4680a91 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 1 Jul 2022 16:31:47 -0700 Subject: update libcxx to llvm 14.0.6 --- lib/libcxx/include/stack | 64 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 11 deletions(-) (limited to 'lib/libcxx/include/stack') diff --git a/lib/libcxx/include/stack b/lib/libcxx/include/stack index aefef31ac9..ad65d7b29b 100644 --- a/lib/libcxx/include/stack +++ b/lib/libcxx/include/stack @@ -1,5 +1,5 @@ // -*- C++ -*- -//===---------------------------- stack -----------------------------------===// +//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -41,11 +41,14 @@ public: explicit stack(const container_type& c); explicit stack(container_type&& c); + template stack(InputIterator first, InputIterator last); // since C++23 template explicit stack(const Alloc& a); template stack(const container_type& c, const Alloc& a); template stack(container_type&& c, const Alloc& a); template stack(const stack& c, const Alloc& a); template stack(stack&& c, const Alloc& a); + template + stack(InputIterator first, InputIterator last, const Alloc&); // since C++23 bool empty() const; size_type size() const; @@ -63,9 +66,17 @@ public: template stack(Container) -> stack; // C++17 +template + stack(InputIterator, InputIterator) -> stack>; // since C++23 + template stack(Container, Allocator) -> stack; // C++17 +template + stack(InputIterator, InputIterator, Allocator) + -> stack, + deque, Allocator>>; // since C++23 + template bool operator==(const stack& x, const stack& y); template @@ -88,9 +99,12 @@ template */ #include <__config> +#include <__iterator/iterator_traits.h> #include <__memory/uses_allocator.h> #include <__utility/forward.h> #include +#include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -158,31 +172,45 @@ public: template _LIBCPP_INLINE_VISIBILITY explicit stack(const _Alloc& __a, - _EnableIf::value>* = 0) + __enable_if_t::value>* = 0) : c(__a) {} template _LIBCPP_INLINE_VISIBILITY stack(const container_type& __c, const _Alloc& __a, - _EnableIf::value>* = 0) + __enable_if_t::value>* = 0) : c(__c, __a) {} template _LIBCPP_INLINE_VISIBILITY stack(const stack& __s, const _Alloc& __a, - _EnableIf::value>* = 0) + __enable_if_t::value>* = 0) : c(__s.c, __a) {} #ifndef _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY stack(container_type&& __c, const _Alloc& __a, - _EnableIf::value>* = 0) + __enable_if_t::value>* = 0) : c(_VSTD::move(__c), __a) {} template _LIBCPP_INLINE_VISIBILITY stack(stack&& __s, const _Alloc& __a, - _EnableIf::value>* = 0) + __enable_if_t::value>* = 0) : c(_VSTD::move(__s.c), __a) {} #endif // _LIBCPP_CXX03_LANG +#if _LIBCPP_STD_VER > 20 + template ::value>> + _LIBCPP_HIDE_FROM_ABI + stack(_InputIterator __first, _InputIterator __last) : c(__first, __last) {} + + template ::value>, + class = __enable_if_t::value>> + _LIBCPP_HIDE_FROM_ABI + stack(_InputIterator __first, _InputIterator __last, const _Alloc& __alloc) : c(__first, __last, __alloc) {} +#endif + _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY bool empty() const {return c.empty();} _LIBCPP_INLINE_VISIBILITY @@ -231,22 +259,36 @@ public: operator< (const stack& __x, const stack& __y); }; -#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +#if _LIBCPP_STD_VER > 14 template::value> + class = enable_if_t::value> > stack(_Container) -> stack; template::value>, - class = _EnableIf::value> + class = enable_if_t::value>, + class = enable_if_t::value> > stack(_Container, _Alloc) -> stack; #endif +#if _LIBCPP_STD_VER > 20 +template::value>> +stack(_InputIterator, _InputIterator) + -> stack<__iter_value_type<_InputIterator>>; + +template::value>, + class = __enable_if_t<__is_allocator<_Alloc>::value>> +stack(_InputIterator, _InputIterator, _Alloc) + -> stack<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>; +#endif + template inline _LIBCPP_INLINE_VISIBILITY bool @@ -297,7 +339,7 @@ operator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) template inline _LIBCPP_INLINE_VISIBILITY -_EnableIf<__is_swappable<_Container>::value, void> +__enable_if_t<__is_swappable<_Container>::value, void> swap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) { -- cgit v1.2.3