Ticket #7330: function_template.hpp.diff
File function_template.hpp.diff, 2.1 KB (added by , 10 years ago) |
---|
-
function/function_template.hpp
748 748 { 749 749 this->assign_to_own(f); 750 750 } 751 751 752 #ifndef BOOST_NO_RVALUE_REFERENCES 753 BOOST_FUNCTION_FUNCTION(BOOST_FUNCTION_FUNCTION&& f) : function_base() 754 { 755 this->move_assign(f); 756 } 757 #endif 758 752 759 ~BOOST_FUNCTION_FUNCTION() { clear(); } 753 760 754 761 result_type operator()(BOOST_FUNCTION_PARMS) const … … 830 837 BOOST_CATCH_END 831 838 return *this; 832 839 } 840 841 #ifndef BOOST_NO_RVALUE_REFERENCES 842 // Move assignment from another BOOST_FUNCTION_FUNCTION 843 BOOST_FUNCTION_FUNCTION& operator=(BOOST_FUNCTION_FUNCTION&& f) 844 { 845 846 if (&f == this) 847 return *this; 833 848 849 this->clear(); 850 BOOST_TRY { 851 this->move_assign(f); 852 } BOOST_CATCH (...) { 853 vtable = 0; 854 BOOST_RETHROW; 855 } 856 BOOST_CATCH_END 857 return *this; 858 } 859 #endif 860 834 861 void swap(BOOST_FUNCTION_FUNCTION& other) 835 862 { 836 863 if (&other == this) … … 1063 1090 1064 1091 function(const base_type& f) : base_type(static_cast<const base_type&>(f)){} 1065 1092 1093 #ifndef BOOST_NO_RVALUE_REFERENCES 1094 // Move constructors 1095 function(self_type&& f): base_type(static_cast<base_type&&>(f)){} 1096 function(base_type&& f): base_type(static_cast<base_type&&>(f)){} 1097 #endif 1098 1066 1099 self_type& operator=(const self_type& f) 1067 1100 { 1068 1101 self_type(f).swap(*this); 1069 1102 return *this; 1070 1103 } 1071 1104 1105 #ifndef BOOST_NO_RVALUE_REFERENCES 1106 self_type& operator=(self_type&& f) 1107 { 1108 self_type(static_cast<self_type&&>(f)).swap(*this); 1109 return *this; 1110 } 1111 #endif 1112 1072 1113 template<typename Functor> 1073 1114 #ifndef BOOST_NO_SFINAE 1074 1115 typename enable_if_c< … … 1097 1138 self_type(f).swap(*this); 1098 1139 return *this; 1099 1140 } 1141 1142 #ifndef BOOST_NO_RVALUE_REFERENCES 1143 self_type& operator=(base_type&& f) 1144 { 1145 self_type(static_cast<base_type&&>(f)).swap(*this); 1146 return *this; 1147 } 1148 #endif 1100 1149 }; 1101 1150 1102 1151 #undef BOOST_FUNCTION_PARTIAL_SPEC