What is the difference between std::move and std::forward? When would you use move semantics over traditional copying?

Last updated 21 June 2026

  • std::move is an unconditional cast to T&& that moves nothing itself. It enables move operations and leaves the source valid but unspecified.

  • std::forward conditionally casts a forwarding reference in templates, preserving lvalue/rvalue category (perfect forwarding).

  • Move instead of copy when the source is expiring or ownership is handed off. It pays off most for heap-owning types like std::vector and std::string.

  • https://utkrusht.ai/blog/cplusplus-interview-questions
  • https://roadmap.sh/questions/cpp
  • https://internshala.com/blog/cpp-coding-interview-questions/
All C++ interview questions