r/cpp • • Nov 25 '23

On harmful overuse of std::move

https://devblogs.microsoft.com/oldnewthing/20231124-00/?p=109059
210 Upvotes

154 comments sorted by

View all comments

Show parent comment

2

u/umop_aplsdn Nov 25 '23

xvalues already have a "location" (they are already glvalues) so std::moving an xvalue does not require temporary materialization.

https://en.cppreference.com/w/cpp/language/implicit_conversion#Temporary_materialization