C++23 Implicit Moves: Say Goodbye to std::move

Move in C++ without a std:move

C++23 Implicit Moves: Say Goodbye to std::move

Andreas Fertig explores how C++23's implicit move rules simplify code and improve performance. He revisits his earlier advice to use std::move rarely, showing that with C++23, functions returning rvalue reference parameters now move automatically, eliminating the need for manual std::move calls. This change builds on guaranteed copy elision since C++17 and makes following his advice easier than ever.

Once you switch your compiler to C++23 mode, both cases do an implicit move. No std::move required.
  1. sprocketz

    What is that makes NVRO so much more difficult to implement? Why couldn't they mandate that just like RVO?

    Do compilers literally just special case a simple return statement of a direct construction or something?

  2. fluoridation

    Unfortunately, I don't think there's getting away from just understanding value semantics to get the correct and/or performant behavior.

  3. tom_

    If the author is reading: both complicated examples are the same.

More from this day

2026-09-02