// Queue implementation -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
-// 2010, 2011
-// Free Software Foundation, Inc.
+// Copyright (C) 2001-2013 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
*
* @ingroup sequences
*
+ * @tparam _Tp Type of element.
+ * @tparam _Sequence Type of underlying sequence, defaults to deque<_Tp>.
+ *
* Meets many of the requirements of a
* <a href="tables.html#65">container</a>,
* but does not define anything to do with iterators. Very few of the
/**
* @brief Default constructor creates no elements.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus < 201103L
explicit
queue(const _Sequence& __c = _Sequence())
: c(__c) { }
push(const value_type& __x)
{ c.push_back(__x); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
void
push(value_type&& __x)
{ c.push_back(std::move(__x)); }
c.pop_front();
}
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
void
swap(queue& __q)
noexcept(noexcept(swap(c, __q.c)))
operator>=(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
{ return !(__x < __y); }
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
template<typename _Tp, typename _Seq>
inline void
swap(queue<_Tp, _Seq>& __x, queue<_Tp, _Seq>& __y)
*
* @ingroup sequences
*
+ * @tparam _Tp Type of element.
+ * @tparam _Sequence Type of underlying sequence, defaults to vector<_Tp>.
+ * @tparam _Compare Comparison function object type, defaults to
+ * less<_Sequence::value_type>.
+ *
* This is not a true container, but an @e adaptor. It holds
* another container, and provides a wrapper interface to that
* container. The wrapper is what enforces priority-based sorting
/**
* @brief Default constructor creates no elements.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus < 201103L
explicit
priority_queue(const _Compare& __x = _Compare(),
const _Sequence& __s = _Sequence())
* documentation on @link functors functor base
* classes@endlink.
*/
-#ifndef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus < 201103L
template<typename _InputIterator>
priority_queue(_InputIterator __first, _InputIterator __last,
const _Compare& __x = _Compare(),
std::push_heap(c.begin(), c.end(), comp);
}
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
void
push(value_type&& __x)
{
c.pop_back();
}
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
void
swap(priority_queue& __pq)
noexcept(noexcept(swap(c, __pq.c)) && noexcept(swap(comp, __pq.comp)))
// No equality/comparison operators are provided for priority_queue.
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#if __cplusplus >= 201103L
template<typename _Tp, typename _Sequence, typename _Compare>
inline void
swap(priority_queue<_Tp, _Sequence, _Compare>& __x,