10b57cec5SDimitry Andric// -*- C++ -*- 2349cc55cSDimitry Andric//===----------------------------------------------------------------------===// 30b57cec5SDimitry Andric// 40b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 50b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 60b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 70b57cec5SDimitry Andric// 80b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 90b57cec5SDimitry Andric 100b57cec5SDimitry Andric#ifndef _LIBCPP_STACK 110b57cec5SDimitry Andric#define _LIBCPP_STACK 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric/* 140b57cec5SDimitry Andric stack synopsis 150b57cec5SDimitry Andric 160b57cec5SDimitry Andricnamespace std 170b57cec5SDimitry Andric{ 180b57cec5SDimitry Andric 190b57cec5SDimitry Andrictemplate <class T, class Container = deque<T>> 200b57cec5SDimitry Andricclass stack 210b57cec5SDimitry Andric{ 220b57cec5SDimitry Andricpublic: 230b57cec5SDimitry Andric typedef Container container_type; 240b57cec5SDimitry Andric typedef typename container_type::value_type value_type; 250b57cec5SDimitry Andric typedef typename container_type::reference reference; 260b57cec5SDimitry Andric typedef typename container_type::const_reference const_reference; 270b57cec5SDimitry Andric typedef typename container_type::size_type size_type; 280b57cec5SDimitry Andric 290b57cec5SDimitry Andricprotected: 300b57cec5SDimitry Andric container_type c; 310b57cec5SDimitry Andric 320b57cec5SDimitry Andricpublic: 330b57cec5SDimitry Andric stack() = default; 340b57cec5SDimitry Andric ~stack() = default; 350b57cec5SDimitry Andric 360b57cec5SDimitry Andric stack(const stack& q) = default; 370b57cec5SDimitry Andric stack(stack&& q) = default; 380b57cec5SDimitry Andric 390b57cec5SDimitry Andric stack& operator=(const stack& q) = default; 400b57cec5SDimitry Andric stack& operator=(stack&& q) = default; 410b57cec5SDimitry Andric 420b57cec5SDimitry Andric explicit stack(const container_type& c); 430b57cec5SDimitry Andric explicit stack(container_type&& c); 44*04eeddc0SDimitry Andric template <class InputIterator> stack(InputIterator first, InputIterator last); // since C++23 450b57cec5SDimitry Andric template <class Alloc> explicit stack(const Alloc& a); 460b57cec5SDimitry Andric template <class Alloc> stack(const container_type& c, const Alloc& a); 470b57cec5SDimitry Andric template <class Alloc> stack(container_type&& c, const Alloc& a); 480b57cec5SDimitry Andric template <class Alloc> stack(const stack& c, const Alloc& a); 490b57cec5SDimitry Andric template <class Alloc> stack(stack&& c, const Alloc& a); 50*04eeddc0SDimitry Andric template<class InputIterator, class Alloc> 51*04eeddc0SDimitry Andric stack(InputIterator first, InputIterator last, const Alloc&); // since C++23 520b57cec5SDimitry Andric 530b57cec5SDimitry Andric bool empty() const; 540b57cec5SDimitry Andric size_type size() const; 550b57cec5SDimitry Andric reference top(); 560b57cec5SDimitry Andric const_reference top() const; 570b57cec5SDimitry Andric 580b57cec5SDimitry Andric void push(const value_type& x); 590b57cec5SDimitry Andric void push(value_type&& x); 600b57cec5SDimitry Andric template <class... Args> reference emplace(Args&&... args); // reference in C++17 610b57cec5SDimitry Andric void pop(); 620b57cec5SDimitry Andric 630b57cec5SDimitry Andric void swap(stack& c) noexcept(is_nothrow_swappable_v<Container>) 640b57cec5SDimitry Andric}; 650b57cec5SDimitry Andric 660b57cec5SDimitry Andrictemplate<class Container> 670b57cec5SDimitry Andric stack(Container) -> stack<typename Container::value_type, Container>; // C++17 680b57cec5SDimitry Andric 69*04eeddc0SDimitry Andrictemplate<class InputIterator> 70*04eeddc0SDimitry Andric stack(InputIterator, InputIterator) -> stack<iter-value-type<InputIterator>>; // since C++23 71*04eeddc0SDimitry Andric 720b57cec5SDimitry Andrictemplate<class Container, class Allocator> 730b57cec5SDimitry Andric stack(Container, Allocator) -> stack<typename Container::value_type, Container>; // C++17 740b57cec5SDimitry Andric 75*04eeddc0SDimitry Andrictemplate<class InputIterator, class Allocator> 76*04eeddc0SDimitry Andric stack(InputIterator, InputIterator, Allocator) 77*04eeddc0SDimitry Andric -> stack<iter-value-type<InputIterator>, 78*04eeddc0SDimitry Andric deque<iter-value-type<InputIterator>, Allocator>>; // since C++23 79*04eeddc0SDimitry Andric 800b57cec5SDimitry Andrictemplate <class T, class Container> 810b57cec5SDimitry Andric bool operator==(const stack<T, Container>& x, const stack<T, Container>& y); 820b57cec5SDimitry Andrictemplate <class T, class Container> 830b57cec5SDimitry Andric bool operator< (const stack<T, Container>& x, const stack<T, Container>& y); 840b57cec5SDimitry Andrictemplate <class T, class Container> 850b57cec5SDimitry Andric bool operator!=(const stack<T, Container>& x, const stack<T, Container>& y); 860b57cec5SDimitry Andrictemplate <class T, class Container> 870b57cec5SDimitry Andric bool operator> (const stack<T, Container>& x, const stack<T, Container>& y); 880b57cec5SDimitry Andrictemplate <class T, class Container> 890b57cec5SDimitry Andric bool operator>=(const stack<T, Container>& x, const stack<T, Container>& y); 900b57cec5SDimitry Andrictemplate <class T, class Container> 910b57cec5SDimitry Andric bool operator<=(const stack<T, Container>& x, const stack<T, Container>& y); 920b57cec5SDimitry Andric 930b57cec5SDimitry Andrictemplate <class T, class Container> 940b57cec5SDimitry Andric void swap(stack<T, Container>& x, stack<T, Container>& y) 950b57cec5SDimitry Andric noexcept(noexcept(x.swap(y))); 960b57cec5SDimitry Andric 970b57cec5SDimitry Andric} // std 980b57cec5SDimitry Andric 990b57cec5SDimitry Andric*/ 1000b57cec5SDimitry Andric 1010b57cec5SDimitry Andric#include <__config> 102*04eeddc0SDimitry Andric#include <__iterator/iterator_traits.h> 103fe6060f1SDimitry Andric#include <__memory/uses_allocator.h> 104fe6060f1SDimitry Andric#include <__utility/forward.h> 1050b57cec5SDimitry Andric#include <deque> 106*04eeddc0SDimitry Andric#include <type_traits> 107*04eeddc0SDimitry Andric#include <version> 1080b57cec5SDimitry Andric 1090b57cec5SDimitry Andric#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 1100b57cec5SDimitry Andric#pragma GCC system_header 1110b57cec5SDimitry Andric#endif 1120b57cec5SDimitry Andric 1130b57cec5SDimitry Andric_LIBCPP_BEGIN_NAMESPACE_STD 1140b57cec5SDimitry Andric 1150b57cec5SDimitry Andrictemplate <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TEMPLATE_VIS stack; 1160b57cec5SDimitry Andric 1170b57cec5SDimitry Andrictemplate <class _Tp, class _Container> 1180b57cec5SDimitry Andric_LIBCPP_INLINE_VISIBILITY 1190b57cec5SDimitry Andricbool 1200b57cec5SDimitry Andricoperator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y); 1210b57cec5SDimitry Andric 1220b57cec5SDimitry Andrictemplate <class _Tp, class _Container> 1230b57cec5SDimitry Andric_LIBCPP_INLINE_VISIBILITY 1240b57cec5SDimitry Andricbool 1250b57cec5SDimitry Andricoperator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y); 1260b57cec5SDimitry Andric 1270b57cec5SDimitry Andrictemplate <class _Tp, class _Container /*= deque<_Tp>*/> 1280b57cec5SDimitry Andricclass _LIBCPP_TEMPLATE_VIS stack 1290b57cec5SDimitry Andric{ 1300b57cec5SDimitry Andricpublic: 1310b57cec5SDimitry Andric typedef _Container container_type; 1320b57cec5SDimitry Andric typedef typename container_type::value_type value_type; 1330b57cec5SDimitry Andric typedef typename container_type::reference reference; 1340b57cec5SDimitry Andric typedef typename container_type::const_reference const_reference; 1350b57cec5SDimitry Andric typedef typename container_type::size_type size_type; 1360b57cec5SDimitry Andric static_assert((is_same<_Tp, value_type>::value), "" ); 1370b57cec5SDimitry Andric 1380b57cec5SDimitry Andricprotected: 1390b57cec5SDimitry Andric container_type c; 1400b57cec5SDimitry Andric 1410b57cec5SDimitry Andricpublic: 1420b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1430b57cec5SDimitry Andric stack() 1440b57cec5SDimitry Andric _NOEXCEPT_(is_nothrow_default_constructible<container_type>::value) 1450b57cec5SDimitry Andric : c() {} 1460b57cec5SDimitry Andric 1470b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1480b57cec5SDimitry Andric stack(const stack& __q) : c(__q.c) {} 1490b57cec5SDimitry Andric 1500b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1510b57cec5SDimitry Andric stack& operator=(const stack& __q) {c = __q.c; return *this;} 1520b57cec5SDimitry Andric 1530b57cec5SDimitry Andric 1540b57cec5SDimitry Andric#ifndef _LIBCPP_CXX03_LANG 1550b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1560b57cec5SDimitry Andric stack(stack&& __q) 1570b57cec5SDimitry Andric _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value) 1580b57cec5SDimitry Andric : c(_VSTD::move(__q.c)) {} 1590b57cec5SDimitry Andric 1600b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1610b57cec5SDimitry Andric stack& operator=(stack&& __q) 1620b57cec5SDimitry Andric _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value) 1630b57cec5SDimitry Andric {c = _VSTD::move(__q.c); return *this;} 1640b57cec5SDimitry Andric 1650b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1660b57cec5SDimitry Andric explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {} 1670b57cec5SDimitry Andric#endif // _LIBCPP_CXX03_LANG 1680b57cec5SDimitry Andric 1690b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1700b57cec5SDimitry Andric explicit stack(const container_type& __c) : c(__c) {} 1710b57cec5SDimitry Andric 1720b57cec5SDimitry Andric template <class _Alloc> 1730b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1740b57cec5SDimitry Andric explicit stack(const _Alloc& __a, 175349cc55cSDimitry Andric __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0) 1760b57cec5SDimitry Andric : c(__a) {} 1770b57cec5SDimitry Andric template <class _Alloc> 1780b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1790b57cec5SDimitry Andric stack(const container_type& __c, const _Alloc& __a, 180349cc55cSDimitry Andric __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0) 1810b57cec5SDimitry Andric : c(__c, __a) {} 1820b57cec5SDimitry Andric template <class _Alloc> 1830b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1840b57cec5SDimitry Andric stack(const stack& __s, const _Alloc& __a, 185349cc55cSDimitry Andric __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0) 1860b57cec5SDimitry Andric : c(__s.c, __a) {} 1870b57cec5SDimitry Andric#ifndef _LIBCPP_CXX03_LANG 1880b57cec5SDimitry Andric template <class _Alloc> 1890b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1900b57cec5SDimitry Andric stack(container_type&& __c, const _Alloc& __a, 191349cc55cSDimitry Andric __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0) 1920b57cec5SDimitry Andric : c(_VSTD::move(__c), __a) {} 1930b57cec5SDimitry Andric template <class _Alloc> 1940b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 1950b57cec5SDimitry Andric stack(stack&& __s, const _Alloc& __a, 196349cc55cSDimitry Andric __enable_if_t<uses_allocator<container_type, _Alloc>::value>* = 0) 1970b57cec5SDimitry Andric : c(_VSTD::move(__s.c), __a) {} 1980b57cec5SDimitry Andric#endif // _LIBCPP_CXX03_LANG 1990b57cec5SDimitry Andric 200*04eeddc0SDimitry Andric#if _LIBCPP_STD_VER > 20 201*04eeddc0SDimitry Andric template <class _InputIterator, 202*04eeddc0SDimitry Andric class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>> 203*04eeddc0SDimitry Andric _LIBCPP_HIDE_FROM_ABI 204*04eeddc0SDimitry Andric stack(_InputIterator __first, _InputIterator __last) : c(__first, __last) {} 205*04eeddc0SDimitry Andric 206*04eeddc0SDimitry Andric template <class _InputIterator, 207*04eeddc0SDimitry Andric class _Alloc, 208*04eeddc0SDimitry Andric class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>, 209*04eeddc0SDimitry Andric class = __enable_if_t<uses_allocator<container_type, _Alloc>::value>> 210*04eeddc0SDimitry Andric _LIBCPP_HIDE_FROM_ABI 211*04eeddc0SDimitry Andric stack(_InputIterator __first, _InputIterator __last, const _Alloc& __alloc) : c(__first, __last, __alloc) {} 212*04eeddc0SDimitry Andric#endif 213*04eeddc0SDimitry Andric 2140b57cec5SDimitry Andric _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY 2150b57cec5SDimitry Andric bool empty() const {return c.empty();} 2160b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 2170b57cec5SDimitry Andric size_type size() const {return c.size();} 2180b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 2190b57cec5SDimitry Andric reference top() {return c.back();} 2200b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 2210b57cec5SDimitry Andric const_reference top() const {return c.back();} 2220b57cec5SDimitry Andric 2230b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 2240b57cec5SDimitry Andric void push(const value_type& __v) {c.push_back(__v);} 2250b57cec5SDimitry Andric#ifndef _LIBCPP_CXX03_LANG 2260b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 2270b57cec5SDimitry Andric void push(value_type&& __v) {c.push_back(_VSTD::move(__v));} 2280b57cec5SDimitry Andric 2290b57cec5SDimitry Andric template <class... _Args> 2300b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 2310b57cec5SDimitry Andric#if _LIBCPP_STD_VER > 14 2320b57cec5SDimitry Andric decltype(auto) emplace(_Args&&... __args) 2330b57cec5SDimitry Andric { return c.emplace_back(_VSTD::forward<_Args>(__args)...);} 2340b57cec5SDimitry Andric#else 2350b57cec5SDimitry Andric void emplace(_Args&&... __args) 2360b57cec5SDimitry Andric { c.emplace_back(_VSTD::forward<_Args>(__args)...);} 2370b57cec5SDimitry Andric#endif 2380b57cec5SDimitry Andric#endif // _LIBCPP_CXX03_LANG 2390b57cec5SDimitry Andric 2400b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 2410b57cec5SDimitry Andric void pop() {c.pop_back();} 2420b57cec5SDimitry Andric 2430b57cec5SDimitry Andric _LIBCPP_INLINE_VISIBILITY 2440b57cec5SDimitry Andric void swap(stack& __s) 2450b57cec5SDimitry Andric _NOEXCEPT_(__is_nothrow_swappable<container_type>::value) 2460b57cec5SDimitry Andric { 2470b57cec5SDimitry Andric using _VSTD::swap; 2480b57cec5SDimitry Andric swap(c, __s.c); 2490b57cec5SDimitry Andric } 2500b57cec5SDimitry Andric 2510b57cec5SDimitry Andric template <class T1, class _C1> 2520b57cec5SDimitry Andric friend 2530b57cec5SDimitry Andric bool 2540b57cec5SDimitry Andric operator==(const stack<T1, _C1>& __x, const stack<T1, _C1>& __y); 2550b57cec5SDimitry Andric 2560b57cec5SDimitry Andric template <class T1, class _C1> 2570b57cec5SDimitry Andric friend 2580b57cec5SDimitry Andric bool 2590b57cec5SDimitry Andric operator< (const stack<T1, _C1>& __x, const stack<T1, _C1>& __y); 2600b57cec5SDimitry Andric}; 2610b57cec5SDimitry Andric 262*04eeddc0SDimitry Andric#if _LIBCPP_STD_VER > 14 2630b57cec5SDimitry Andrictemplate<class _Container, 264349cc55cSDimitry Andric class = enable_if_t<!__is_allocator<_Container>::value> 2650b57cec5SDimitry Andric> 2660b57cec5SDimitry Andricstack(_Container) 2670b57cec5SDimitry Andric -> stack<typename _Container::value_type, _Container>; 2680b57cec5SDimitry Andric 2690b57cec5SDimitry Andrictemplate<class _Container, 2700b57cec5SDimitry Andric class _Alloc, 271349cc55cSDimitry Andric class = enable_if_t<!__is_allocator<_Container>::value>, 272349cc55cSDimitry Andric class = enable_if_t<uses_allocator<_Container, _Alloc>::value> 2730b57cec5SDimitry Andric > 2740b57cec5SDimitry Andricstack(_Container, _Alloc) 2750b57cec5SDimitry Andric -> stack<typename _Container::value_type, _Container>; 2760b57cec5SDimitry Andric#endif 2770b57cec5SDimitry Andric 278*04eeddc0SDimitry Andric#if _LIBCPP_STD_VER > 20 279*04eeddc0SDimitry Andrictemplate<class _InputIterator, 280*04eeddc0SDimitry Andric class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>> 281*04eeddc0SDimitry Andricstack(_InputIterator, _InputIterator) 282*04eeddc0SDimitry Andric -> stack<__iter_value_type<_InputIterator>>; 283*04eeddc0SDimitry Andric 284*04eeddc0SDimitry Andrictemplate<class _InputIterator, 285*04eeddc0SDimitry Andric class _Alloc, 286*04eeddc0SDimitry Andric class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>, 287*04eeddc0SDimitry Andric class = __enable_if_t<__is_allocator<_Alloc>::value>> 288*04eeddc0SDimitry Andricstack(_InputIterator, _InputIterator, _Alloc) 289*04eeddc0SDimitry Andric -> stack<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>; 290*04eeddc0SDimitry Andric#endif 291*04eeddc0SDimitry Andric 2920b57cec5SDimitry Andrictemplate <class _Tp, class _Container> 2930b57cec5SDimitry Andricinline _LIBCPP_INLINE_VISIBILITY 2940b57cec5SDimitry Andricbool 2950b57cec5SDimitry Andricoperator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) 2960b57cec5SDimitry Andric{ 2970b57cec5SDimitry Andric return __x.c == __y.c; 2980b57cec5SDimitry Andric} 2990b57cec5SDimitry Andric 3000b57cec5SDimitry Andrictemplate <class _Tp, class _Container> 3010b57cec5SDimitry Andricinline _LIBCPP_INLINE_VISIBILITY 3020b57cec5SDimitry Andricbool 3030b57cec5SDimitry Andricoperator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) 3040b57cec5SDimitry Andric{ 3050b57cec5SDimitry Andric return __x.c < __y.c; 3060b57cec5SDimitry Andric} 3070b57cec5SDimitry Andric 3080b57cec5SDimitry Andrictemplate <class _Tp, class _Container> 3090b57cec5SDimitry Andricinline _LIBCPP_INLINE_VISIBILITY 3100b57cec5SDimitry Andricbool 3110b57cec5SDimitry Andricoperator!=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) 3120b57cec5SDimitry Andric{ 3130b57cec5SDimitry Andric return !(__x == __y); 3140b57cec5SDimitry Andric} 3150b57cec5SDimitry Andric 3160b57cec5SDimitry Andrictemplate <class _Tp, class _Container> 3170b57cec5SDimitry Andricinline _LIBCPP_INLINE_VISIBILITY 3180b57cec5SDimitry Andricbool 3190b57cec5SDimitry Andricoperator> (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) 3200b57cec5SDimitry Andric{ 3210b57cec5SDimitry Andric return __y < __x; 3220b57cec5SDimitry Andric} 3230b57cec5SDimitry Andric 3240b57cec5SDimitry Andrictemplate <class _Tp, class _Container> 3250b57cec5SDimitry Andricinline _LIBCPP_INLINE_VISIBILITY 3260b57cec5SDimitry Andricbool 3270b57cec5SDimitry Andricoperator>=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) 3280b57cec5SDimitry Andric{ 3290b57cec5SDimitry Andric return !(__x < __y); 3300b57cec5SDimitry Andric} 3310b57cec5SDimitry Andric 3320b57cec5SDimitry Andrictemplate <class _Tp, class _Container> 3330b57cec5SDimitry Andricinline _LIBCPP_INLINE_VISIBILITY 3340b57cec5SDimitry Andricbool 3350b57cec5SDimitry Andricoperator<=(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y) 3360b57cec5SDimitry Andric{ 3370b57cec5SDimitry Andric return !(__y < __x); 3380b57cec5SDimitry Andric} 3390b57cec5SDimitry Andric 3400b57cec5SDimitry Andrictemplate <class _Tp, class _Container> 3410b57cec5SDimitry Andricinline _LIBCPP_INLINE_VISIBILITY 342349cc55cSDimitry Andric__enable_if_t<__is_swappable<_Container>::value, void> 3430b57cec5SDimitry Andricswap(stack<_Tp, _Container>& __x, stack<_Tp, _Container>& __y) 3440b57cec5SDimitry Andric _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) 3450b57cec5SDimitry Andric{ 3460b57cec5SDimitry Andric __x.swap(__y); 3470b57cec5SDimitry Andric} 3480b57cec5SDimitry Andric 3490b57cec5SDimitry Andrictemplate <class _Tp, class _Container, class _Alloc> 3500b57cec5SDimitry Andricstruct _LIBCPP_TEMPLATE_VIS uses_allocator<stack<_Tp, _Container>, _Alloc> 3510b57cec5SDimitry Andric : public uses_allocator<_Container, _Alloc> 3520b57cec5SDimitry Andric{ 3530b57cec5SDimitry Andric}; 3540b57cec5SDimitry Andric 3550b57cec5SDimitry Andric_LIBCPP_END_NAMESPACE_STD 3560b57cec5SDimitry Andric 3570b57cec5SDimitry Andric#endif // _LIBCPP_STACK 358