id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 7330,Patch adding move constructors and move assignments,Antony Polukhin,Douglas Gregor,"Use of move constructor and move assignment reduce memory allocation/deallocations count and do not call functor copy operator for big functors. Example: {{{ struct big_aggregating_structure { int disable_small_objects_optimizations[32]; void operator()() {} }; ... function f1 = big_aggregating_structure(); function f2 = f1; // will call new, copy() function f3 = std::move(f1); // Just swaps pointers, leaves f1 empty f3 = f2; // Will call new, copy(), destory(), delete f3 = std::move(f2); // Just swaps pointers, leaves f2 empty (calls destory(), delete for f3) { function f_new1 = big_aggregating_structure(); function f_new2 = std::move(f_new1); // Without move constructor, there will be additional new, copy(), destroy(), delete calls } }}} This patch could be very usefull for boost::asio, boost::thread and anyone, who uses boost::function in STL containers on C++11 compilers. Patch was tested on MSVC2010, GCC-4.6",Patches,closed,To Be Determined,function,Boost Development Trunk,Optimization,fixed,,