简体   繁体   English

std::move() 和 std::add_rvalue_reference() 之间的区别

[英]Difference between std::move() and std::add_rvalue_reference()

Can somebody explain the difference between std::move() and std::add_rvalue_reference() ?有人可以解释std::move()std::add_rvalue_reference()之间的区别吗? Do both serve the same purpose?两者的目的相同吗? If yes, what is the advantage of one over the other?如果是的话,一个比另一个有什么优势?

std::move is a cast on an object, std::add_rvalue_reference manipulates a type, other than both dealing with r-value references they aren't really related. std::move是对 object 的强制转换, std::add_rvalue_reference操纵一个类型,除了处理它们并不真正相关的 r 值引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM