Explain the difference between an lvalue and an rvalue. Why was the concept of rvalue references introduced in C++11?

Last updated 21 June 2026

  • An lvalue has identity and an address (a named variable). An rvalue is a temporary or pure value about to expire (a literal, a + b).

  • C++11 rvalue references (T&&) let code detect temporaries and steal their resources instead of deep-copying, enabling move semantics and perfect forwarding.

  • A named rvalue reference is itself an lvalue, so std::move is needed to pass it on as an rvalue.

  • https://dev.to/sandordargo/const-rvalue-references-11lo
  • https://dev.to/bashtech1/c-references-tutorial-complete-guide-to-aliases-performance-and-modern-c-2025-509h
  • https://dev.to/million_formula_3be3d915d/c-tips-and-tricks-for-advanced-developers-4hkd
All C++ interview questions