When is the move constructor called in the `std::move()` function?

走远了吗. 提交于 2019-11-30 17:39:32

There is no move construction going on. std::move() accepts a reference and returns a reference. std::move() is basically just a cast.

Your guess 4. is the right one (assuming that you are actually calling a move constructor in the end).

std::move is just a type cast, it tells the compiler that the type is an rvalue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!