Tagged articles
2 articles
Page 1 of 1
Deepin Linux
Deepin Linux
Aug 25, 2025 · Fundamentals

Mastering std::move and std::forward: A Deep Dive into C++ Value Categories

This article explains the concepts of lvalues and rvalues in C++, how std::move converts a named object into an rvalue to enable move semantics, and how std::forward preserves the original value category for perfect forwarding in template functions, illustrated with clear examples and code snippets.

Clvaluemove semantics
0 likes · 26 min read
Mastering std::move and std::forward: A Deep Dive into C++ Value Categories
Tencent Cloud Developer
Tencent Cloud Developer
Oct 26, 2023 · Fundamentals

C++ Value Categories: lvalue, prvalue, xvalue, and Their Role in Function Returns and Move Semantics

The article explains how C++ value categories—lvalue, prvalue, and xvalue—govern function return handling, parameter passing, and object lifetimes, detailing hidden out‑parameters, copy‑elision, const‑reference lifetime extension, rvalue references, and the role of std::move in enabling move semantics.

AssemblyC++lvalue
0 likes · 47 min read
C++ Value Categories: lvalue, prvalue, xvalue, and Their Role in Function Returns and Move Semantics