1.swap整数很容易, 但是swap 大型的数据用临时变量的方法就会耗费很大。
function std::move exists that converts any lvalue (or rvalue) into an
rvalue. Note that the name is misleading; std::move doesn’t move anything; rather, it makes
a value subject to be moved.
所以std::move实际上听迷惑人的, 他 是让一个对象变成rvalue, 也就是说变成准备好可以被移动的状态。static_cast 也是这个用处
以下的例子中, 下面的写法很可能比上边的更快(很可能是优化代码的一个点)
原文:https://www.cnblogs.com/yunpengk/p/13123596.html