Ticket #2319: function_assignment.patch
File function_assignment.patch, 1.1 KB (added by , 14 years ago) |
---|
-
function_template.hpp
786 786 else vtable = 0; 787 787 } 788 788 789 protected: 789 790 // Moves the value from the specified argument to *this. If the argument 790 791 // has its function object allocated on the heap, move_assign will pass 791 792 // its buffer to *this, and set the argument's buffer pointer to NULL. … … 913 914 914 915 function(const base_type& f) : base_type(static_cast<const base_type&>(f)){} 915 916 916 self_type& operator=( const self_type&f)917 self_type& operator=(self_type f) 917 918 { 918 self_type(f).swap(*this);919 this->move_assign(f); 919 920 return *this; 920 921 } 921 922 … … 930 931 #endif 931 932 operator=(Functor f) 932 933 { 933 self_type(f).swap(*this); 934 self_type temp(f); 935 this->move_assign(temp); 934 936 return *this; 935 937 } 936 938 … … 944 946 945 947 self_type& operator=(const base_type& f) 946 948 { 947 self_type(f).swap(*this); 949 self_type temp(f); 950 this->move_assign(temp); 948 951 return *this; 949 952 } 950 953 };