xref: /minix3/external/bsd/libc++/dist/libcxx/include/queue (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
14684ddb6SLionel Sambuc// -*- C++ -*-
24684ddb6SLionel Sambuc//===--------------------------- queue ------------------------------------===//
34684ddb6SLionel Sambuc//
44684ddb6SLionel Sambuc//                     The LLVM Compiler Infrastructure
54684ddb6SLionel Sambuc//
64684ddb6SLionel Sambuc// This file is dual licensed under the MIT and the University of Illinois Open
74684ddb6SLionel Sambuc// Source Licenses. See LICENSE.TXT for details.
84684ddb6SLionel Sambuc//
94684ddb6SLionel Sambuc//===----------------------------------------------------------------------===//
104684ddb6SLionel Sambuc
114684ddb6SLionel Sambuc#ifndef _LIBCPP_QUEUE
124684ddb6SLionel Sambuc#define _LIBCPP_QUEUE
134684ddb6SLionel Sambuc
144684ddb6SLionel Sambuc/*
154684ddb6SLionel Sambuc    queue synopsis
164684ddb6SLionel Sambuc
174684ddb6SLionel Sambucnamespace std
184684ddb6SLionel Sambuc{
194684ddb6SLionel Sambuc
204684ddb6SLionel Sambuctemplate <class T, class Container = deque<T>>
214684ddb6SLionel Sambucclass queue
224684ddb6SLionel Sambuc{
234684ddb6SLionel Sambucpublic:
244684ddb6SLionel Sambuc    typedef Container                                container_type;
254684ddb6SLionel Sambuc    typedef typename container_type::value_type      value_type;
264684ddb6SLionel Sambuc    typedef typename container_type::reference       reference;
274684ddb6SLionel Sambuc    typedef typename container_type::const_reference const_reference;
284684ddb6SLionel Sambuc    typedef typename container_type::size_type       size_type;
294684ddb6SLionel Sambuc
304684ddb6SLionel Sambucprotected:
314684ddb6SLionel Sambuc    container_type c;
324684ddb6SLionel Sambuc
334684ddb6SLionel Sambucpublic:
344684ddb6SLionel Sambuc    queue() = default;
354684ddb6SLionel Sambuc    ~queue() = default;
364684ddb6SLionel Sambuc
374684ddb6SLionel Sambuc    queue(const queue& q) = default;
384684ddb6SLionel Sambuc    queue(queue&& q) = default;
394684ddb6SLionel Sambuc
404684ddb6SLionel Sambuc    queue& operator=(const queue& q) = default;
414684ddb6SLionel Sambuc    queue& operator=(queue&& q) = default;
424684ddb6SLionel Sambuc
434684ddb6SLionel Sambuc    explicit queue(const container_type& c);
444684ddb6SLionel Sambuc    explicit queue(container_type&& c)
454684ddb6SLionel Sambuc    template <class Alloc>
464684ddb6SLionel Sambuc        explicit queue(const Alloc& a);
474684ddb6SLionel Sambuc    template <class Alloc>
484684ddb6SLionel Sambuc        queue(const container_type& c, const Alloc& a);
494684ddb6SLionel Sambuc    template <class Alloc>
504684ddb6SLionel Sambuc        queue(container_type&& c, const Alloc& a);
514684ddb6SLionel Sambuc    template <class Alloc>
524684ddb6SLionel Sambuc        queue(const queue& q, const Alloc& a);
534684ddb6SLionel Sambuc    template <class Alloc>
544684ddb6SLionel Sambuc        queue(queue&& q, const Alloc& a);
554684ddb6SLionel Sambuc
564684ddb6SLionel Sambuc    bool      empty() const;
574684ddb6SLionel Sambuc    size_type size() const;
584684ddb6SLionel Sambuc
594684ddb6SLionel Sambuc    reference       front();
604684ddb6SLionel Sambuc    const_reference front() const;
614684ddb6SLionel Sambuc    reference       back();
624684ddb6SLionel Sambuc    const_reference back() const;
634684ddb6SLionel Sambuc
644684ddb6SLionel Sambuc    void push(const value_type& v);
654684ddb6SLionel Sambuc    void push(value_type&& v);
664684ddb6SLionel Sambuc    template <class... Args> void emplace(Args&&... args);
674684ddb6SLionel Sambuc    void pop();
684684ddb6SLionel Sambuc
694684ddb6SLionel Sambuc    void swap(queue& q) noexcept(noexcept(swap(c, q.c)));
704684ddb6SLionel Sambuc};
714684ddb6SLionel Sambuc
724684ddb6SLionel Sambuctemplate <class T, class Container>
734684ddb6SLionel Sambuc  bool operator==(const queue<T, Container>& x,const queue<T, Container>& y);
744684ddb6SLionel Sambuc
754684ddb6SLionel Sambuctemplate <class T, class Container>
764684ddb6SLionel Sambuc  bool operator< (const queue<T, Container>& x,const queue<T, Container>& y);
774684ddb6SLionel Sambuc
784684ddb6SLionel Sambuctemplate <class T, class Container>
794684ddb6SLionel Sambuc  bool operator!=(const queue<T, Container>& x,const queue<T, Container>& y);
804684ddb6SLionel Sambuc
814684ddb6SLionel Sambuctemplate <class T, class Container>
824684ddb6SLionel Sambuc  bool operator> (const queue<T, Container>& x,const queue<T, Container>& y);
834684ddb6SLionel Sambuc
844684ddb6SLionel Sambuctemplate <class T, class Container>
854684ddb6SLionel Sambuc  bool operator>=(const queue<T, Container>& x,const queue<T, Container>& y);
864684ddb6SLionel Sambuc
874684ddb6SLionel Sambuctemplate <class T, class Container>
884684ddb6SLionel Sambuc  bool operator<=(const queue<T, Container>& x,const queue<T, Container>& y);
894684ddb6SLionel Sambuc
904684ddb6SLionel Sambuctemplate <class T, class Container>
914684ddb6SLionel Sambuc  void swap(queue<T, Container>& x, queue<T, Container>& y)
924684ddb6SLionel Sambuc  noexcept(noexcept(x.swap(y)));
934684ddb6SLionel Sambuc
944684ddb6SLionel Sambuctemplate <class T, class Container = vector<T>,
954684ddb6SLionel Sambuc          class Compare = less<typename Container::value_type>>
964684ddb6SLionel Sambucclass priority_queue
974684ddb6SLionel Sambuc{
984684ddb6SLionel Sambucpublic:
994684ddb6SLionel Sambuc    typedef Container                                container_type;
1004684ddb6SLionel Sambuc    typedef typename container_type::value_type      value_type;
1014684ddb6SLionel Sambuc    typedef typename container_type::reference       reference;
1024684ddb6SLionel Sambuc    typedef typename container_type::const_reference const_reference;
1034684ddb6SLionel Sambuc    typedef typename container_type::size_type       size_type;
1044684ddb6SLionel Sambuc
1054684ddb6SLionel Sambucprotected:
1064684ddb6SLionel Sambuc    container_type c;
1074684ddb6SLionel Sambuc    Compare comp;
1084684ddb6SLionel Sambuc
1094684ddb6SLionel Sambucpublic:
1104684ddb6SLionel Sambuc    priority_queue() = default;
1114684ddb6SLionel Sambuc    ~priority_queue() = default;
1124684ddb6SLionel Sambuc
1134684ddb6SLionel Sambuc    priority_queue(const priority_queue& q) = default;
1144684ddb6SLionel Sambuc    priority_queue(priority_queue&& q) = default;
1154684ddb6SLionel Sambuc
1164684ddb6SLionel Sambuc    priority_queue& operator=(const priority_queue& q) = default;
1174684ddb6SLionel Sambuc    priority_queue& operator=(priority_queue&& q) = default;
1184684ddb6SLionel Sambuc
1194684ddb6SLionel Sambuc    explicit priority_queue(const Compare& comp);
1204684ddb6SLionel Sambuc    priority_queue(const Compare& comp, const container_type& c);
1214684ddb6SLionel Sambuc    explicit priority_queue(const Compare& comp, container_type&& c);
1224684ddb6SLionel Sambuc    template <class InputIterator>
1234684ddb6SLionel Sambuc        priority_queue(InputIterator first, InputIterator last,
1244684ddb6SLionel Sambuc                       const Compare& comp = Compare());
1254684ddb6SLionel Sambuc    template <class InputIterator>
1264684ddb6SLionel Sambuc        priority_queue(InputIterator first, InputIterator last,
1274684ddb6SLionel Sambuc                       const Compare& comp, const container_type& c);
1284684ddb6SLionel Sambuc    template <class InputIterator>
1294684ddb6SLionel Sambuc        priority_queue(InputIterator first, InputIterator last,
1304684ddb6SLionel Sambuc                       const Compare& comp, container_type&& c);
1314684ddb6SLionel Sambuc    template <class Alloc>
1324684ddb6SLionel Sambuc        explicit priority_queue(const Alloc& a);
1334684ddb6SLionel Sambuc    template <class Alloc>
1344684ddb6SLionel Sambuc        priority_queue(const Compare& comp, const Alloc& a);
1354684ddb6SLionel Sambuc    template <class Alloc>
1364684ddb6SLionel Sambuc        priority_queue(const Compare& comp, const container_type& c,
1374684ddb6SLionel Sambuc                       const Alloc& a);
1384684ddb6SLionel Sambuc    template <class Alloc>
1394684ddb6SLionel Sambuc        priority_queue(const Compare& comp, container_type&& c,
1404684ddb6SLionel Sambuc                       const Alloc& a);
1414684ddb6SLionel Sambuc    template <class Alloc>
1424684ddb6SLionel Sambuc        priority_queue(const priority_queue& q, const Alloc& a);
1434684ddb6SLionel Sambuc    template <class Alloc>
1444684ddb6SLionel Sambuc        priority_queue(priority_queue&& q, const Alloc& a);
1454684ddb6SLionel Sambuc
1464684ddb6SLionel Sambuc    bool            empty() const;
1474684ddb6SLionel Sambuc    size_type       size() const;
1484684ddb6SLionel Sambuc    const_reference top() const;
1494684ddb6SLionel Sambuc
1504684ddb6SLionel Sambuc    void push(const value_type& v);
1514684ddb6SLionel Sambuc    void push(value_type&& v);
1524684ddb6SLionel Sambuc    template <class... Args> void emplace(Args&&... args);
1534684ddb6SLionel Sambuc    void pop();
1544684ddb6SLionel Sambuc
1554684ddb6SLionel Sambuc    void swap(priority_queue& q)
1564684ddb6SLionel Sambuc        noexcept(noexcept(swap(c, q.c)) && noexcept(swap(comp.q.comp)));
1574684ddb6SLionel Sambuc};
1584684ddb6SLionel Sambuc
1594684ddb6SLionel Sambuctemplate <class T, class Container, class Compare>
1604684ddb6SLionel Sambuc  void swap(priority_queue<T, Container, Compare>& x,
1614684ddb6SLionel Sambuc            priority_queue<T, Container, Compare>& y)
1624684ddb6SLionel Sambuc            noexcept(noexcept(x.swap(y)));
1634684ddb6SLionel Sambuc
1644684ddb6SLionel Sambuc}  // std
1654684ddb6SLionel Sambuc
1664684ddb6SLionel Sambuc*/
1674684ddb6SLionel Sambuc
1684684ddb6SLionel Sambuc#include <__config>
1694684ddb6SLionel Sambuc#include <deque>
1704684ddb6SLionel Sambuc#include <vector>
1714684ddb6SLionel Sambuc#include <functional>
1724684ddb6SLionel Sambuc#include <algorithm>
1734684ddb6SLionel Sambuc
1744684ddb6SLionel Sambuc#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1754684ddb6SLionel Sambuc#pragma GCC system_header
1764684ddb6SLionel Sambuc#endif
1774684ddb6SLionel Sambuc
1784684ddb6SLionel Sambuc_LIBCPP_BEGIN_NAMESPACE_STD
1794684ddb6SLionel Sambuc
180*0a6a1f1dSLionel Sambuctemplate <class _Tp, class _Container = deque<_Tp> > class _LIBCPP_TYPE_VIS_ONLY queue;
1814684ddb6SLionel Sambuc
1824684ddb6SLionel Sambuctemplate <class _Tp, class _Container>
1834684ddb6SLionel Sambuc_LIBCPP_INLINE_VISIBILITY
1844684ddb6SLionel Sambucbool
1854684ddb6SLionel Sambucoperator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
1864684ddb6SLionel Sambuc
1874684ddb6SLionel Sambuctemplate <class _Tp, class _Container>
1884684ddb6SLionel Sambuc_LIBCPP_INLINE_VISIBILITY
1894684ddb6SLionel Sambucbool
1904684ddb6SLionel Sambucoperator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
1914684ddb6SLionel Sambuc
192*0a6a1f1dSLionel Sambuctemplate <class _Tp, class _Container /*= deque<_Tp>*/>
1934684ddb6SLionel Sambucclass _LIBCPP_TYPE_VIS_ONLY queue
1944684ddb6SLionel Sambuc{
1954684ddb6SLionel Sambucpublic:
1964684ddb6SLionel Sambuc    typedef _Container                               container_type;
1974684ddb6SLionel Sambuc    typedef typename container_type::value_type      value_type;
1984684ddb6SLionel Sambuc    typedef typename container_type::reference       reference;
1994684ddb6SLionel Sambuc    typedef typename container_type::const_reference const_reference;
2004684ddb6SLionel Sambuc    typedef typename container_type::size_type       size_type;
2014684ddb6SLionel Sambuc
2024684ddb6SLionel Sambucprotected:
2034684ddb6SLionel Sambuc    container_type c;
2044684ddb6SLionel Sambuc
2054684ddb6SLionel Sambucpublic:
2064684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2074684ddb6SLionel Sambuc    queue()
2084684ddb6SLionel Sambuc        _NOEXCEPT_(is_nothrow_default_constructible<container_type>::value)
2094684ddb6SLionel Sambuc        : c() {}
2104684ddb6SLionel Sambuc
2114684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2124684ddb6SLionel Sambuc    queue(const queue& __q) : c(__q.c) {}
2134684ddb6SLionel Sambuc
2144684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2154684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2164684ddb6SLionel Sambuc    queue(queue&& __q)
2174684ddb6SLionel Sambuc        _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
2184684ddb6SLionel Sambuc        : c(_VSTD::move(__q.c)) {}
2194684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2204684ddb6SLionel Sambuc
2214684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2224684ddb6SLionel Sambuc    queue& operator=(const queue& __q) {c = __q.c; return *this;}
2234684ddb6SLionel Sambuc
2244684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2254684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2264684ddb6SLionel Sambuc    queue& operator=(queue&& __q)
2274684ddb6SLionel Sambuc        _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
2284684ddb6SLionel Sambuc        {c = _VSTD::move(__q.c); return *this;}
2294684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2304684ddb6SLionel Sambuc
2314684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2324684ddb6SLionel Sambuc    explicit queue(const container_type& __c)  : c(__c) {}
2334684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2344684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2354684ddb6SLionel Sambuc    explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {}
2364684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2374684ddb6SLionel Sambuc    template <class _Alloc>
2384684ddb6SLionel Sambuc        _LIBCPP_INLINE_VISIBILITY
2394684ddb6SLionel Sambuc        explicit queue(const _Alloc& __a,
2404684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
2414684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0)
2424684ddb6SLionel Sambuc            : c(__a) {}
2434684ddb6SLionel Sambuc    template <class _Alloc>
2444684ddb6SLionel Sambuc        _LIBCPP_INLINE_VISIBILITY
2454684ddb6SLionel Sambuc        queue(const queue& __q, const _Alloc& __a,
2464684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
2474684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0)
2484684ddb6SLionel Sambuc            : c(__q.c, __a) {}
2494684ddb6SLionel Sambuc    template <class _Alloc>
2504684ddb6SLionel Sambuc        _LIBCPP_INLINE_VISIBILITY
2514684ddb6SLionel Sambuc        queue(const container_type& __c, const _Alloc& __a,
2524684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
2534684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0)
2544684ddb6SLionel Sambuc            : c(__c, __a) {}
2554684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2564684ddb6SLionel Sambuc    template <class _Alloc>
2574684ddb6SLionel Sambuc        _LIBCPP_INLINE_VISIBILITY
2584684ddb6SLionel Sambuc        queue(container_type&& __c, const _Alloc& __a,
2594684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
2604684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0)
2614684ddb6SLionel Sambuc            : c(_VSTD::move(__c), __a) {}
2624684ddb6SLionel Sambuc    template <class _Alloc>
2634684ddb6SLionel Sambuc        _LIBCPP_INLINE_VISIBILITY
2644684ddb6SLionel Sambuc        queue(queue&& __q, const _Alloc& __a,
2654684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
2664684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0)
2674684ddb6SLionel Sambuc            : c(_VSTD::move(__q.c), __a) {}
2684684ddb6SLionel Sambuc
2694684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2704684ddb6SLionel Sambuc
2714684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2724684ddb6SLionel Sambuc    bool      empty() const {return c.empty();}
2734684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2744684ddb6SLionel Sambuc    size_type size() const  {return c.size();}
2754684ddb6SLionel Sambuc
2764684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2774684ddb6SLionel Sambuc    reference       front()       {return c.front();}
2784684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2794684ddb6SLionel Sambuc    const_reference front() const {return c.front();}
2804684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2814684ddb6SLionel Sambuc    reference       back()        {return c.back();}
2824684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2834684ddb6SLionel Sambuc    const_reference back() const  {return c.back();}
2844684ddb6SLionel Sambuc
2854684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2864684ddb6SLionel Sambuc    void push(const value_type& __v) {c.push_back(__v);}
2874684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2884684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2894684ddb6SLionel Sambuc    void push(value_type&& __v)      {c.push_back(_VSTD::move(__v));}
2904684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_VARIADICS
2914684ddb6SLionel Sambuc    template <class... _Args>
2924684ddb6SLionel Sambuc        _LIBCPP_INLINE_VISIBILITY
2934684ddb6SLionel Sambuc        void emplace(_Args&&... __args)
2944684ddb6SLionel Sambuc            {c.emplace_back(_VSTD::forward<_Args>(__args)...);}
2954684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_VARIADICS
2964684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2974684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
2984684ddb6SLionel Sambuc    void pop() {c.pop_front();}
2994684ddb6SLionel Sambuc
3004684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
3014684ddb6SLionel Sambuc    void swap(queue& __q)
3024684ddb6SLionel Sambuc        _NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
3034684ddb6SLionel Sambuc    {
3044684ddb6SLionel Sambuc        using _VSTD::swap;
3054684ddb6SLionel Sambuc        swap(c, __q.c);
3064684ddb6SLionel Sambuc    }
3074684ddb6SLionel Sambuc
3084684ddb6SLionel Sambuc    template <class _T1, class _C1>
3094684ddb6SLionel Sambuc    friend
3104684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
3114684ddb6SLionel Sambuc    bool
3124684ddb6SLionel Sambuc    operator==(const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
3134684ddb6SLionel Sambuc
3144684ddb6SLionel Sambuc    template <class _T1, class _C1>
3154684ddb6SLionel Sambuc    friend
3164684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
3174684ddb6SLionel Sambuc    bool
3184684ddb6SLionel Sambuc    operator< (const queue<_T1, _C1>& __x,const queue<_T1, _C1>& __y);
3194684ddb6SLionel Sambuc};
3204684ddb6SLionel Sambuc
3214684ddb6SLionel Sambuctemplate <class _Tp, class _Container>
3224684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
3234684ddb6SLionel Sambucbool
3244684ddb6SLionel Sambucoperator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
3254684ddb6SLionel Sambuc{
3264684ddb6SLionel Sambuc    return __x.c == __y.c;
3274684ddb6SLionel Sambuc}
3284684ddb6SLionel Sambuc
3294684ddb6SLionel Sambuctemplate <class _Tp, class _Container>
3304684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
3314684ddb6SLionel Sambucbool
3324684ddb6SLionel Sambucoperator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
3334684ddb6SLionel Sambuc{
3344684ddb6SLionel Sambuc    return __x.c < __y.c;
3354684ddb6SLionel Sambuc}
3364684ddb6SLionel Sambuc
3374684ddb6SLionel Sambuctemplate <class _Tp, class _Container>
3384684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
3394684ddb6SLionel Sambucbool
3404684ddb6SLionel Sambucoperator!=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
3414684ddb6SLionel Sambuc{
3424684ddb6SLionel Sambuc    return !(__x == __y);
3434684ddb6SLionel Sambuc}
3444684ddb6SLionel Sambuc
3454684ddb6SLionel Sambuctemplate <class _Tp, class _Container>
3464684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
3474684ddb6SLionel Sambucbool
3484684ddb6SLionel Sambucoperator> (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
3494684ddb6SLionel Sambuc{
3504684ddb6SLionel Sambuc    return __y < __x;
3514684ddb6SLionel Sambuc}
3524684ddb6SLionel Sambuc
3534684ddb6SLionel Sambuctemplate <class _Tp, class _Container>
3544684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
3554684ddb6SLionel Sambucbool
3564684ddb6SLionel Sambucoperator>=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
3574684ddb6SLionel Sambuc{
3584684ddb6SLionel Sambuc    return !(__x < __y);
3594684ddb6SLionel Sambuc}
3604684ddb6SLionel Sambuc
3614684ddb6SLionel Sambuctemplate <class _Tp, class _Container>
3624684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
3634684ddb6SLionel Sambucbool
3644684ddb6SLionel Sambucoperator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y)
3654684ddb6SLionel Sambuc{
3664684ddb6SLionel Sambuc    return !(__y < __x);
3674684ddb6SLionel Sambuc}
3684684ddb6SLionel Sambuc
3694684ddb6SLionel Sambuctemplate <class _Tp, class _Container>
3704684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
3714684ddb6SLionel Sambucvoid
3724684ddb6SLionel Sambucswap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y)
3734684ddb6SLionel Sambuc    _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
3744684ddb6SLionel Sambuc{
3754684ddb6SLionel Sambuc    __x.swap(__y);
3764684ddb6SLionel Sambuc}
3774684ddb6SLionel Sambuc
3784684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Alloc>
3794684ddb6SLionel Sambucstruct _LIBCPP_TYPE_VIS_ONLY uses_allocator<queue<_Tp, _Container>, _Alloc>
3804684ddb6SLionel Sambuc    : public uses_allocator<_Container, _Alloc>
3814684ddb6SLionel Sambuc{
3824684ddb6SLionel Sambuc};
3834684ddb6SLionel Sambuc
3844684ddb6SLionel Sambuctemplate <class _Tp, class _Container = vector<_Tp>,
3854684ddb6SLionel Sambuc          class _Compare = less<typename _Container::value_type> >
3864684ddb6SLionel Sambucclass _LIBCPP_TYPE_VIS_ONLY priority_queue
3874684ddb6SLionel Sambuc{
3884684ddb6SLionel Sambucpublic:
3894684ddb6SLionel Sambuc    typedef _Container                               container_type;
3904684ddb6SLionel Sambuc    typedef _Compare                                 value_compare;
3914684ddb6SLionel Sambuc    typedef typename container_type::value_type      value_type;
3924684ddb6SLionel Sambuc    typedef typename container_type::reference       reference;
3934684ddb6SLionel Sambuc    typedef typename container_type::const_reference const_reference;
3944684ddb6SLionel Sambuc    typedef typename container_type::size_type       size_type;
3954684ddb6SLionel Sambuc
3964684ddb6SLionel Sambucprotected:
3974684ddb6SLionel Sambuc    container_type c;
3984684ddb6SLionel Sambuc    value_compare comp;
3994684ddb6SLionel Sambuc
4004684ddb6SLionel Sambucpublic:
4014684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
4024684ddb6SLionel Sambuc    priority_queue()
4034684ddb6SLionel Sambuc        _NOEXCEPT_(is_nothrow_default_constructible<container_type>::value &&
4044684ddb6SLionel Sambuc                   is_nothrow_default_constructible<value_compare>::value)
4054684ddb6SLionel Sambuc        : c(), comp() {}
4064684ddb6SLionel Sambuc
4074684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
4084684ddb6SLionel Sambuc    priority_queue(const priority_queue& __q) : c(__q.c), comp(__q.comp) {}
4094684ddb6SLionel Sambuc
4104684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4114684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
4124684ddb6SLionel Sambuc    priority_queue(priority_queue&& __q)
4134684ddb6SLionel Sambuc        _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value &&
4144684ddb6SLionel Sambuc                   is_nothrow_move_constructible<value_compare>::value)
4154684ddb6SLionel Sambuc        : c(_VSTD::move(__q.c)), comp(_VSTD::move(__q.comp)) {}
4164684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4174684ddb6SLionel Sambuc
4184684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
4194684ddb6SLionel Sambuc    priority_queue& operator=(const priority_queue& __q)
4204684ddb6SLionel Sambuc        {c = __q.c; comp = __q.comp; return *this;}
4214684ddb6SLionel Sambuc
4224684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4234684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
4244684ddb6SLionel Sambuc    priority_queue& operator=(priority_queue&& __q)
4254684ddb6SLionel Sambuc        _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value &&
4264684ddb6SLionel Sambuc                   is_nothrow_move_assignable<value_compare>::value)
4274684ddb6SLionel Sambuc        {c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;}
4284684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4294684ddb6SLionel Sambuc
4304684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
4314684ddb6SLionel Sambuc    explicit priority_queue(const value_compare& __comp)
4324684ddb6SLionel Sambuc        : c(), comp(__comp) {}
4334684ddb6SLionel Sambuc    priority_queue(const value_compare& __comp, const container_type& __c);
4344684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4354684ddb6SLionel Sambuc    explicit priority_queue(const value_compare& __comp, container_type&& __c);
4364684ddb6SLionel Sambuc#endif
4374684ddb6SLionel Sambuc    template <class _InputIter>
4384684ddb6SLionel Sambuc        priority_queue(_InputIter __f, _InputIter __l,
4394684ddb6SLionel Sambuc                       const value_compare& __comp = value_compare());
4404684ddb6SLionel Sambuc    template <class _InputIter>
4414684ddb6SLionel Sambuc        priority_queue(_InputIter __f, _InputIter __l,
4424684ddb6SLionel Sambuc                       const value_compare& __comp, const container_type& __c);
4434684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4444684ddb6SLionel Sambuc    template <class _InputIter>
4454684ddb6SLionel Sambuc        priority_queue(_InputIter __f, _InputIter __l,
4464684ddb6SLionel Sambuc                       const value_compare& __comp, container_type&& __c);
4474684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4484684ddb6SLionel Sambuc    template <class _Alloc>
4494684ddb6SLionel Sambuc        explicit priority_queue(const _Alloc& __a,
4504684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
4514684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0);
4524684ddb6SLionel Sambuc    template <class _Alloc>
4534684ddb6SLionel Sambuc        priority_queue(const value_compare& __comp, const _Alloc& __a,
4544684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
4554684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0);
4564684ddb6SLionel Sambuc    template <class _Alloc>
4574684ddb6SLionel Sambuc        priority_queue(const value_compare& __comp, const container_type& __c,
4584684ddb6SLionel Sambuc                       const _Alloc& __a,
4594684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
4604684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0);
4614684ddb6SLionel Sambuc    template <class _Alloc>
4624684ddb6SLionel Sambuc        priority_queue(const priority_queue& __q, const _Alloc& __a,
4634684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
4644684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0);
4654684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4664684ddb6SLionel Sambuc    template <class _Alloc>
4674684ddb6SLionel Sambuc        priority_queue(const value_compare& __comp, container_type&& __c,
4684684ddb6SLionel Sambuc                       const _Alloc& __a,
4694684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
4704684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0);
4714684ddb6SLionel Sambuc    template <class _Alloc>
4724684ddb6SLionel Sambuc        priority_queue(priority_queue&& __q, const _Alloc& __a,
4734684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
4744684ddb6SLionel Sambuc                                                         _Alloc>::value>::type* = 0);
4754684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4764684ddb6SLionel Sambuc
4774684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
4784684ddb6SLionel Sambuc    bool            empty() const {return c.empty();}
4794684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
4804684ddb6SLionel Sambuc    size_type       size() const  {return c.size();}
4814684ddb6SLionel Sambuc    _LIBCPP_INLINE_VISIBILITY
4824684ddb6SLionel Sambuc    const_reference top() const   {return c.front();}
4834684ddb6SLionel Sambuc
4844684ddb6SLionel Sambuc    void push(const value_type& __v);
4854684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
4864684ddb6SLionel Sambuc    void push(value_type&& __v);
4874684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_VARIADICS
4884684ddb6SLionel Sambuc    template <class... _Args> void emplace(_Args&&... __args);
4894684ddb6SLionel Sambuc#endif
4904684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
4914684ddb6SLionel Sambuc    void pop();
4924684ddb6SLionel Sambuc
4934684ddb6SLionel Sambuc    void swap(priority_queue& __q)
4944684ddb6SLionel Sambuc        _NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
4954684ddb6SLionel Sambuc                   __is_nothrow_swappable<value_compare>::value);
4964684ddb6SLionel Sambuc};
4974684ddb6SLionel Sambuc
4984684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
4994684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
5004684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp,
5014684ddb6SLionel Sambuc                                                          const container_type& __c)
5024684ddb6SLionel Sambuc    : c(__c),
5034684ddb6SLionel Sambuc      comp(__comp)
5044684ddb6SLionel Sambuc{
5054684ddb6SLionel Sambuc    _VSTD::make_heap(c.begin(), c.end(), comp);
5064684ddb6SLionel Sambuc}
5074684ddb6SLionel Sambuc
5084684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
5094684ddb6SLionel Sambuc
5104684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
5114684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
5124684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
5134684ddb6SLionel Sambuc                                                          container_type&& __c)
5144684ddb6SLionel Sambuc    : c(_VSTD::move(__c)),
5154684ddb6SLionel Sambuc      comp(__comp)
5164684ddb6SLionel Sambuc{
5174684ddb6SLionel Sambuc    _VSTD::make_heap(c.begin(), c.end(), comp);
5184684ddb6SLionel Sambuc}
5194684ddb6SLionel Sambuc
5204684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
5214684ddb6SLionel Sambuc
5224684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
5234684ddb6SLionel Sambuctemplate <class _InputIter>
5244684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
5254684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
5264684ddb6SLionel Sambuc                                                          const value_compare& __comp)
5274684ddb6SLionel Sambuc    : c(__f, __l),
5284684ddb6SLionel Sambuc      comp(__comp)
5294684ddb6SLionel Sambuc{
5304684ddb6SLionel Sambuc    _VSTD::make_heap(c.begin(), c.end(), comp);
5314684ddb6SLionel Sambuc}
5324684ddb6SLionel Sambuc
5334684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
5344684ddb6SLionel Sambuctemplate <class _InputIter>
5354684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
5364684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
5374684ddb6SLionel Sambuc                                                          const value_compare& __comp,
5384684ddb6SLionel Sambuc                                                          const container_type& __c)
5394684ddb6SLionel Sambuc    : c(__c),
5404684ddb6SLionel Sambuc      comp(__comp)
5414684ddb6SLionel Sambuc{
5424684ddb6SLionel Sambuc    c.insert(c.end(), __f, __l);
5434684ddb6SLionel Sambuc    _VSTD::make_heap(c.begin(), c.end(), comp);
5444684ddb6SLionel Sambuc}
5454684ddb6SLionel Sambuc
5464684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
5474684ddb6SLionel Sambuc
5484684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
5494684ddb6SLionel Sambuctemplate <class _InputIter>
5504684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
5514684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
5524684ddb6SLionel Sambuc                                                          const value_compare& __comp,
5534684ddb6SLionel Sambuc                                                          container_type&& __c)
5544684ddb6SLionel Sambuc    : c(_VSTD::move(__c)),
5554684ddb6SLionel Sambuc      comp(__comp)
5564684ddb6SLionel Sambuc{
5574684ddb6SLionel Sambuc    c.insert(c.end(), __f, __l);
5584684ddb6SLionel Sambuc    _VSTD::make_heap(c.begin(), c.end(), comp);
5594684ddb6SLionel Sambuc}
5604684ddb6SLionel Sambuc
5614684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
5624684ddb6SLionel Sambuc
5634684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
5644684ddb6SLionel Sambuctemplate <class _Alloc>
5654684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
5664684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a,
5674684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
5684684ddb6SLionel Sambuc                                                         _Alloc>::value>::type*)
5694684ddb6SLionel Sambuc    : c(__a)
5704684ddb6SLionel Sambuc{
5714684ddb6SLionel Sambuc}
5724684ddb6SLionel Sambuc
5734684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
5744684ddb6SLionel Sambuctemplate <class _Alloc>
5754684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
5764684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
5774684ddb6SLionel Sambuc                                                          const _Alloc& __a,
5784684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
5794684ddb6SLionel Sambuc                                                         _Alloc>::value>::type*)
5804684ddb6SLionel Sambuc    : c(__a),
5814684ddb6SLionel Sambuc      comp(__comp)
5824684ddb6SLionel Sambuc{
5834684ddb6SLionel Sambuc}
5844684ddb6SLionel Sambuc
5854684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
5864684ddb6SLionel Sambuctemplate <class _Alloc>
5874684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
5884684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
5894684ddb6SLionel Sambuc                                                          const container_type& __c,
5904684ddb6SLionel Sambuc                                                          const _Alloc& __a,
5914684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
5924684ddb6SLionel Sambuc                                                         _Alloc>::value>::type*)
5934684ddb6SLionel Sambuc    : c(__c, __a),
5944684ddb6SLionel Sambuc      comp(__comp)
5954684ddb6SLionel Sambuc{
5964684ddb6SLionel Sambuc    _VSTD::make_heap(c.begin(), c.end(), comp);
5974684ddb6SLionel Sambuc}
5984684ddb6SLionel Sambuc
5994684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
6004684ddb6SLionel Sambuctemplate <class _Alloc>
6014684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
6024684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& __q,
6034684ddb6SLionel Sambuc                                                          const _Alloc& __a,
6044684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
6054684ddb6SLionel Sambuc                                                         _Alloc>::value>::type*)
6064684ddb6SLionel Sambuc    : c(__q.c, __a),
6074684ddb6SLionel Sambuc      comp(__q.comp)
6084684ddb6SLionel Sambuc{
6094684ddb6SLionel Sambuc    _VSTD::make_heap(c.begin(), c.end(), comp);
6104684ddb6SLionel Sambuc}
6114684ddb6SLionel Sambuc
6124684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
6134684ddb6SLionel Sambuc
6144684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
6154684ddb6SLionel Sambuctemplate <class _Alloc>
6164684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
6174684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
6184684ddb6SLionel Sambuc                                                          container_type&& __c,
6194684ddb6SLionel Sambuc                                                          const _Alloc& __a,
6204684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
6214684ddb6SLionel Sambuc                                                         _Alloc>::value>::type*)
6224684ddb6SLionel Sambuc    : c(_VSTD::move(__c), __a),
6234684ddb6SLionel Sambuc      comp(__comp)
6244684ddb6SLionel Sambuc{
6254684ddb6SLionel Sambuc    _VSTD::make_heap(c.begin(), c.end(), comp);
6264684ddb6SLionel Sambuc}
6274684ddb6SLionel Sambuc
6284684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
6294684ddb6SLionel Sambuctemplate <class _Alloc>
6304684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
6314684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
6324684ddb6SLionel Sambuc                                                          const _Alloc& __a,
6334684ddb6SLionel Sambuc                       typename enable_if<uses_allocator<container_type,
6344684ddb6SLionel Sambuc                                                         _Alloc>::value>::type*)
6354684ddb6SLionel Sambuc    : c(_VSTD::move(__q.c), __a),
6364684ddb6SLionel Sambuc      comp(_VSTD::move(__q.comp))
6374684ddb6SLionel Sambuc{
6384684ddb6SLionel Sambuc    _VSTD::make_heap(c.begin(), c.end(), comp);
6394684ddb6SLionel Sambuc}
6404684ddb6SLionel Sambuc
6414684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
6424684ddb6SLionel Sambuc
6434684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
6444684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
6454684ddb6SLionel Sambucvoid
6464684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::push(const value_type& __v)
6474684ddb6SLionel Sambuc{
6484684ddb6SLionel Sambuc    c.push_back(__v);
6494684ddb6SLionel Sambuc    _VSTD::push_heap(c.begin(), c.end(), comp);
6504684ddb6SLionel Sambuc}
6514684ddb6SLionel Sambuc
6524684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
6534684ddb6SLionel Sambuc
6544684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
6554684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
6564684ddb6SLionel Sambucvoid
6574684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::push(value_type&& __v)
6584684ddb6SLionel Sambuc{
6594684ddb6SLionel Sambuc    c.push_back(_VSTD::move(__v));
6604684ddb6SLionel Sambuc    _VSTD::push_heap(c.begin(), c.end(), comp);
6614684ddb6SLionel Sambuc}
6624684ddb6SLionel Sambuc
6634684ddb6SLionel Sambuc#ifndef _LIBCPP_HAS_NO_VARIADICS
6644684ddb6SLionel Sambuc
6654684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
6664684ddb6SLionel Sambuctemplate <class... _Args>
6674684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
6684684ddb6SLionel Sambucvoid
6694684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
6704684ddb6SLionel Sambuc{
6714684ddb6SLionel Sambuc    c.emplace_back(_VSTD::forward<_Args>(__args)...);
6724684ddb6SLionel Sambuc    _VSTD::push_heap(c.begin(), c.end(), comp);
6734684ddb6SLionel Sambuc}
6744684ddb6SLionel Sambuc
6754684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_VARIADICS
6764684ddb6SLionel Sambuc#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
6774684ddb6SLionel Sambuc
6784684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
6794684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
6804684ddb6SLionel Sambucvoid
6814684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::pop()
6824684ddb6SLionel Sambuc{
6834684ddb6SLionel Sambuc    _VSTD::pop_heap(c.begin(), c.end(), comp);
6844684ddb6SLionel Sambuc    c.pop_back();
6854684ddb6SLionel Sambuc}
6864684ddb6SLionel Sambuc
6874684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
6884684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
6894684ddb6SLionel Sambucvoid
6904684ddb6SLionel Sambucpriority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
6914684ddb6SLionel Sambuc        _NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
6924684ddb6SLionel Sambuc                   __is_nothrow_swappable<value_compare>::value)
6934684ddb6SLionel Sambuc{
6944684ddb6SLionel Sambuc    using _VSTD::swap;
6954684ddb6SLionel Sambuc    swap(c, __q.c);
6964684ddb6SLionel Sambuc    swap(comp, __q.comp);
6974684ddb6SLionel Sambuc}
6984684ddb6SLionel Sambuc
6994684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare>
7004684ddb6SLionel Sambucinline _LIBCPP_INLINE_VISIBILITY
7014684ddb6SLionel Sambucvoid
7024684ddb6SLionel Sambucswap(priority_queue<_Tp, _Container, _Compare>& __x,
7034684ddb6SLionel Sambuc     priority_queue<_Tp, _Container, _Compare>& __y)
7044684ddb6SLionel Sambuc    _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
7054684ddb6SLionel Sambuc{
7064684ddb6SLionel Sambuc    __x.swap(__y);
7074684ddb6SLionel Sambuc}
7084684ddb6SLionel Sambuc
7094684ddb6SLionel Sambuctemplate <class _Tp, class _Container, class _Compare, class _Alloc>
7104684ddb6SLionel Sambucstruct _LIBCPP_TYPE_VIS_ONLY uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
7114684ddb6SLionel Sambuc    : public uses_allocator<_Container, _Alloc>
7124684ddb6SLionel Sambuc{
7134684ddb6SLionel Sambuc};
7144684ddb6SLionel Sambuc
7154684ddb6SLionel Sambuc_LIBCPP_END_NAMESPACE_STD
7164684ddb6SLionel Sambuc
7174684ddb6SLionel Sambuc#endif  // _LIBCPP_QUEUE
718