+2007-11-13 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/deque.tcc (deque<>::_M_push_back_aux,
+ _M_push_front_aux): Do not copy unnecessarily to __t_copy.
+
2007-11-12 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <pcarlini@suse.de>
void
deque<_Tp, _Alloc>::
_M_push_back_aux(_Args&&... __args)
- {
- value_type __t_copy(std::forward<_Args>(__args)...);
#else
void
deque<_Tp, _Alloc>::
_M_push_back_aux(const value_type& __t)
- {
- value_type __t_copy = __t;
#endif
+ {
_M_reserve_map_at_back();
*(this->_M_impl._M_finish._M_node + 1) = this->_M_allocate_node();
try
{
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
this->_M_impl.construct(this->_M_impl._M_finish._M_cur,
- _GLIBCXX_MOVE(__t_copy));
+ std::forward<_Args>(__args)...);
+#else
+ this->_M_impl.construct(this->_M_impl._M_finish._M_cur, __t);
+#endif
this->_M_impl._M_finish._M_set_node(this->_M_impl._M_finish._M_node
+ 1);
this->_M_impl._M_finish._M_cur = this->_M_impl._M_finish._M_first;
void
deque<_Tp, _Alloc>::
_M_push_front_aux(_Args&&... __args)
- {
- value_type __t_copy(std::forward<_Args>(__args)...);
#else
void
deque<_Tp, _Alloc>::
_M_push_front_aux(const value_type& __t)
- {
- value_type __t_copy = __t;
#endif
+ {
_M_reserve_map_at_front();
*(this->_M_impl._M_start._M_node - 1) = this->_M_allocate_node();
try
this->_M_impl._M_start._M_set_node(this->_M_impl._M_start._M_node
- 1);
this->_M_impl._M_start._M_cur = this->_M_impl._M_start._M_last - 1;
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
this->_M_impl.construct(this->_M_impl._M_start._M_cur,
- _GLIBCXX_MOVE(__t_copy));
+ std::forward<_Args>(__args)...);
+#else
+ this->_M_impl.construct(this->_M_impl._M_start._M_cur, __t);
+#endif
}
catch(...)
{