Tagged articles
3 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
Deepin Linux
Deepin Linux
Jul 9, 2025 · Fundamentals

Mastering Perfect Forwarding in C++: Boost Performance and Flexibility

This article explains the concept of perfect forwarding in C++11, demonstrates how to preserve value categories using universal references and std::forward, and provides practical examples such as generic factory functions, wrapper functions, reference collapsing rules, and common pitfalls to avoid.

CUniversal Referencesmove semantics
0 likes · 21 min read
Mastering Perfect Forwarding in C++: Boost Performance and Flexibility
Tencent Cloud Developer
Tencent Cloud Developer
Aug 5, 2022 · Fundamentals

Understanding C++ Move Semantics and std::forward

The article explains C++11 move semantics, showing how std::move forces rvalue treatment and how std::forward preserves value categories for perfect forwarding, illustrating copy vs. move constructors, custom move implementations, and the performance benefits of eliminating unnecessary copies.

C++C++11move semantics
0 likes · 20 min read
Understanding C++ Move Semantics and std::forward