isocpp.org states that:
move-based std::sort() and std::set::insert() have been measured to be 15 times faster than copy based versions[...] if your type has a move operation, you gain the performance benefits automatically from the standard algorithms.
Does this mean that if you call sort()
on a user-defined type that has no move constructor or move assignment operator, then there are no move semantics used? In other words, to get the many benefits of C++11 performance improvements, you should edit existing code to add move operations explicitly?
Further, if you are sorting, is it the container or the type inside the container, or both, that must have move operations defined?