Index: function_template.hpp =================================================================== --- function_template.hpp (revision 48735) +++ function_template.hpp (working copy) @@ -786,6 +786,7 @@ else vtable = 0; } +protected: // Moves the value from the specified argument to *this. If the argument // has its function object allocated on the heap, move_assign will pass // its buffer to *this, and set the argument's buffer pointer to NULL. @@ -913,9 +914,9 @@ function(const base_type& f) : base_type(static_cast(f)){} - self_type& operator=(const self_type& f) + self_type& operator=(self_type f) { - self_type(f).swap(*this); + this->move_assign(f); return *this; } @@ -930,7 +931,8 @@ #endif operator=(Functor f) { - self_type(f).swap(*this); + self_type temp(f); + this->move_assign(temp); return *this; } @@ -944,7 +946,8 @@ self_type& operator=(const base_type& f) { - self_type(f).swap(*this); + self_type temp(f); + this->move_assign(temp); return *this; } };