Commit c54171fe by Paolo Carlini Committed by Paolo Carlini

stl_queue.h (queue<>::push(value_type&&)): Replace with "emplace" version per DR 756.

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.

From-SVN: r129814
parent e52e3000
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.
2007-10-30 Paolo Carlini <pcarlini@suse.de> 2007-10-30 Paolo Carlini <pcarlini@suse.de>
* include/tr1_impl/random (uniform_int<>:: * include/tr1_impl/random (uniform_int<>::
......
...@@ -220,14 +220,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -220,14 +220,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* to it. The time complexity of the operation depends on the * to it. The time complexity of the operation depends on the
* underlying sequence. * underlying sequence.
*/ */
#ifndef __GXX_EXPERIMENTAL_CXX0X__
void void
push(const value_type& __x) push(const value_type& __x)
{ c.push_back(__x); } { c.push_back(__x); }
#else
#ifdef __GXX_EXPERIMENTAL_CXX0X__ // NB: DR 756.
void template<typename... _Args>
push(value_type&& __x) void
{ c.push_back(std::move(__x)); } push(_Args&&... __args)
{ c.push_back(std::forward<_Args>(__args)...); }
#endif #endif
/** /**
...@@ -507,20 +509,22 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -507,20 +509,22 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* The time complexity of the operation depends on the underlying * The time complexity of the operation depends on the underlying
* sequence. * sequence.
*/ */
#ifndef __GXX_EXPERIMENTAL_CXX0X__
void void
push(const value_type& __x) push(const value_type& __x)
{ {
c.push_back(__x); c.push_back(__x);
std::push_heap(c.begin(), c.end(), comp); std::push_heap(c.begin(), c.end(), comp);
} }
#else
#ifdef __GXX_EXPERIMENTAL_CXX0X__ // NB: DR 756.
void template<typename... _Args>
push(value_type&& __x) void
{ push(_Args&&... __args)
c.push_back(std::move(__x)); {
std::push_heap(c.begin(), c.end(), comp); c.push_back(std::forward<_Args>(__args)...);
} std::push_heap(c.begin(), c.end(), comp);
}
#endif #endif
/** /**
......
...@@ -184,14 +184,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std) ...@@ -184,14 +184,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
* to it. The time complexity of the operation depends on the * to it. The time complexity of the operation depends on the
* underlying sequence. * underlying sequence.
*/ */
#ifndef __GXX_EXPERIMENTAL_CXX0X__
void void
push(const value_type& __x) push(const value_type& __x)
{ c.push_back(__x); } { c.push_back(__x); }
#else
#ifdef __GXX_EXPERIMENTAL_CXX0X__ // NB: DR 756.
void template<typename... _Args>
push(value_type&& __x) void
{ c.push_back(std::move(__x)); } push(_Args&&... __args)
{ c.push_back(std::forward<_Args>(__args)...); }
#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