From bbd352bd579eb8b100bc5d4febb1ffed65458ed5 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 2 Feb 2005 18:59:11 +0000 Subject: [PATCH] Give queue a swap() [SVN r27043] --- include/boost/pending/queue.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/boost/pending/queue.hpp b/include/boost/pending/queue.hpp index 5676688a..f5f5b633 100644 --- a/include/boost/pending/queue.hpp +++ b/include/boost/pending/queue.hpp @@ -7,6 +7,7 @@ #define BOOST_QUEUE_HPP #include +#include namespace boost { @@ -57,6 +58,12 @@ public: const_reference back() const { return c.back(); } void push(const value_type& __x) { c.push_back(__x); } void pop() { c.pop_front(); } + + void swap(queue& other) + { + using std::swap; + swap(c, other.c); + } }; template @@ -101,6 +108,10 @@ operator>=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y) return !(__x < __y); } +template +inline void +swap(queue<_Tp, _Sequence>& __x, queue<_Tp, _Sequence>& __y) +{ __x.swap(__y); } } /* namespace boost */