Commit 999209d0 by Paolo Carlini Committed by Paolo Carlini

stl_queue.h (queue<>::swap, [...]): Implement DR 1198.

2011-01-17  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_queue.h (queue<>::swap, priority_queue<>::swap):
	Implement DR 1198.
	* include/bits/stl_stack.h (stack<>::swap): Likewise.

From-SVN: r168914
parent 6c7d1b31
2011-01-17 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_queue.h (queue<>::swap, priority_queue<>::swap):
Implement DR 1198.
* include/bits/stl_stack.h (stack<>::swap): Likewise.
2011-01-16 Paolo Carlini <paolo.carlini@oracle.com> 2011-01-16 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/47323 PR libstdc++/47323
......
// Queue implementation -*- C++ -*- // Queue implementation -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
// 2010, 2011
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -240,7 +241,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -240,7 +241,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#ifdef __GXX_EXPERIMENTAL_CXX0X__ #ifdef __GXX_EXPERIMENTAL_CXX0X__
void void
swap(queue& __q) swap(queue& __q)
{ c.swap(__q.c); } {
using std::swap;
swap(c, __q.c);
}
#endif #endif
}; };
...@@ -526,7 +530,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -526,7 +530,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
swap(priority_queue& __pq) swap(priority_queue& __pq)
{ {
using std::swap; using std::swap;
c.swap(__pq.c); swap(c, __pq.c);
swap(comp, __pq.comp); swap(comp, __pq.comp);
} }
#endif #endif
......
// Stack implementation -*- C++ -*- // Stack implementation -*- C++ -*-
// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
// 2010, 2011
// Free Software Foundation, Inc. // Free Software Foundation, Inc.
// //
// This file is part of the GNU ISO C++ Library. This library is free // This file is part of the GNU ISO C++ Library. This library is free
...@@ -214,7 +215,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -214,7 +215,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
#ifdef __GXX_EXPERIMENTAL_CXX0X__ #ifdef __GXX_EXPERIMENTAL_CXX0X__
void void
swap(stack& __s) swap(stack& __s)
{ c.swap(__s.c); } {
using std::swap;
swap(c, __s.c);
}
#endif #endif
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment