* [v3] DR 756 changes
@ 2007-11-01 1:42 Paolo Carlini
0 siblings, 0 replies; only message in thread
From: Paolo Carlini @ 2007-11-01 1:42 UTC (permalink / raw)
To: Gcc Patch List
[-- Attachment #1: Type: text/plain, Size: 73 bytes --]
Hi,
tested x86_64-linux, committed to mainline.
Paolo.
//////////////
[-- Attachment #2: CL_rvalm_fix --]
[-- Type: text/plain, Size: 270 bytes --]
2007-10-31 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_queue.h (queue<>::push(value_type&&)): Replace
with "emplace" version per DR 756.
(priority_queue<>::push(value_type&&)): Likewise.
* include/bits/stl_stack.h (stack<>::push(value_type&&)): Likewise.
[-- Attachment #3: patch_rvalm_fix --]
[-- Type: text/plain, Size: 2183 bytes --]
Index: include/bits/stl_queue.h
===================================================================
--- include/bits/stl_queue.h (revision 129768)
+++ include/bits/stl_queue.h (working copy)
@@ -220,14 +220,16 @@
* to it. The time complexity of the operation depends on the
* underlying sequence.
*/
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push(const value_type& __x)
{ c.push_back(__x); }
-
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- void
- push(value_type&& __x)
- { c.push_back(std::move(__x)); }
+#else
+ // NB: DR 756.
+ template<typename... _Args>
+ void
+ push(_Args&&... __args)
+ { c.push_back(std::forward<_Args>(__args)...); }
#endif
/**
@@ -507,20 +509,22 @@
* The time complexity of the operation depends on the underlying
* sequence.
*/
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push(const value_type& __x)
{
c.push_back(__x);
std::push_heap(c.begin(), c.end(), comp);
}
-
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- void
- push(value_type&& __x)
- {
- c.push_back(std::move(__x));
- std::push_heap(c.begin(), c.end(), comp);
- }
+#else
+ // NB: DR 756.
+ template<typename... _Args>
+ void
+ push(_Args&&... __args)
+ {
+ c.push_back(std::forward<_Args>(__args)...);
+ std::push_heap(c.begin(), c.end(), comp);
+ }
#endif
/**
Index: include/bits/stl_stack.h
===================================================================
--- include/bits/stl_stack.h (revision 129768)
+++ include/bits/stl_stack.h (working copy)
@@ -184,14 +184,16 @@
* to it. The time complexity of the operation depends on the
* underlying sequence.
*/
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
void
push(const value_type& __x)
{ c.push_back(__x); }
-
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
- void
- push(value_type&& __x)
- { c.push_back(std::move(__x)); }
+#else
+ // NB: DR 756.
+ template<typename... _Args>
+ void
+ push(_Args&&... __args)
+ { c.push_back(std::forward<_Args>(__args)...); }
#endif
/**
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-11-01 1:42 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-01 1:42 [v3] DR 756 changes Paolo Carlini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).