Patchwork [v3] Implement DR 1198

login
register
mail settings
Submitter Paolo Carlini
Date Jan. 17, 2011, 5:37 p.m.
Message ID <4D347E59.8010908@oracle.com>
Download mbox | patch
Permalink /patch/79202/
State New
Headers show

Comments

Paolo Carlini - Jan. 17, 2011, 5:37 p.m.
Hi,

this is also a matter of consistency, pretty safe to fix. Tested
x86_64-linux, committed.

Paolo.

//////////////////
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.

Patch

Index: include/bits/stl_queue.h
===================================================================
--- include/bits/stl_queue.h	(revision 168912)
+++ include/bits/stl_queue.h	(working copy)
@@ -1,6 +1,7 @@ 
 // 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.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -240,7 +241,10 @@ 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       void
       swap(queue& __q)
-      { c.swap(__q.c); }
+      {
+	using std::swap;
+	swap(c, __q.c);
+      }
 #endif
     };
 
@@ -526,7 +530,7 @@ 
       swap(priority_queue& __pq)
       {
 	using std::swap;
-	c.swap(__pq.c);
+	swap(c, __pq.c);
 	swap(comp, __pq.comp);
       }
 #endif
Index: include/bits/stl_stack.h
===================================================================
--- include/bits/stl_stack.h	(revision 168912)
+++ include/bits/stl_stack.h	(working copy)
@@ -1,6 +1,7 @@ 
 // 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.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -214,7 +215,10 @@ 
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
       void
       swap(stack& __s)
-      { c.swap(__s.c); }
+      {
+	using std::swap;
+	swap(c, __s.c);
+      }
 #endif
     };