diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-11-01 01:40:56 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-11-01 01:40:56 +0000 |
commit | b778bb488c31be88495b84ef01337033703b2fa1 (patch) | |
tree | b1572adaeb85be07c23ecff5d44311be7603e911 /libstdc++-v3/include/bits/stl_queue.h | |
parent | 5a8506c235c378a9c3592172b6741f0eda270ca2 (diff) | |
download | ppe42-gcc-b778bb488c31be88495b84ef01337033703b2fa1.tar.gz ppe42-gcc-b778bb488c31be88495b84ef01337033703b2fa1.zip |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@129814 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/stl_queue.h')
-rw-r--r-- | libstdc++-v3/include/bits/stl_queue.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h index d772c0360ac..4ab3c46c0b8 100644 --- a/libstdc++-v3/include/bits/stl_queue.h +++ b/libstdc++-v3/include/bits/stl_queue.h @@ -220,14 +220,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * 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 @@ _GLIBCXX_BEGIN_NAMESPACE(std) * 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 /** |