Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between std::move() and std::add_rvalue_reference()

Tags:

c++

c++11

Can somebody explain the difference between std::move() and std::add_rvalue_reference()? Do both serve the same purpose? If yes, what is the advantage of one over the other?

like image 585
Harry Avatar asked Mar 01 '23 19:03

Harry


1 Answers

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.

like image 152
Alan Birtles Avatar answered Mar 13 '23 02:03

Alan Birtles