* include/std/functional (function<>::swap): Use std::swap.
* include/tr1/functional (function<>::swap): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164952
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-10-04 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/functional (function<>::swap): Use std::swap.
+ * include/tr1/functional (function<>::swap): Likewise.
+
2010-10-04 Andreas Schwab <schwab@redhat.com>
* acinclude.m4 (GLIBCXX_ENABLE): Properly quote argument to
*/
void swap(function& __x)
{
- _Any_data __old_functor = _M_functor;
- _M_functor = __x._M_functor;
- __x._M_functor = __old_functor;
- _Manager_type __old_manager = _M_manager;
- _M_manager = __x._M_manager;
- __x._M_manager = __old_manager;
- _Invoker_type __old_invoker = _M_invoker;
- _M_invoker = __x._M_invoker;
- __x._M_invoker = __old_invoker;
+ std::swap(_M_functor, __x._M_functor);
+ std::swap(_M_manager, __x._M_manager);
+ std::swap(_M_invoker, __x._M_invoker);
}
// TODO: needs allocator_arg_t
*/
void swap(function& __x)
{
- _Any_data __old_functor = _M_functor;
- _M_functor = __x._M_functor;
- __x._M_functor = __old_functor;
- _Manager_type __old_manager = _M_manager;
- _M_manager = __x._M_manager;
- __x._M_manager = __old_manager;
- _Invoker_type __old_invoker = _M_invoker;
- _M_invoker = __x._M_invoker;
- __x._M_invoker = __old_invoker;
+ std::swap(_M_functor, __x._M_functor);
+ std::swap(_M_manager, __x._M_manager);
+ std::swap(_M_invoker, __x._M_invoker);
}
// [3.7.2.3] function capacity