Back to Basics: C++ Move Semantics
summary
Explains concrete rules and worked examples: why mark noexcept move ctors, how to write efficient move constructor and move assignment using std::exchange/unique_ptr so no allocation occurs, how vector reallocation can force copies unless moves are noexcept, when std::move destroys caller-owned state vs when to use std::forward in templates, what a moved‑from object can legally hold, and how ref‑qualifiers let rvalue overloads avoid extra copies — includes code patterns that demonstrate each outcome.
AI-written summary · about
chapters (15)
- 0:00Start
- 11:37Temporary Object
- 18:37L and R Value References
- 22:36Mental Model
- 25:02Copy Operations
- 26:27The Move Operations
- 27:55Swapping Pointers
- 28:55Move from Object
- 30:39Types of Move Semantics
- 31:16Non-Destructive Move
- 38:29Allocation Strategy
- 47:28Make Functions
- 55:44Ref Qualifiers
- 56:22Append
- 58:39Introducing Ref Qualifiers
related talks
01h 04mBack to Basics: Move Semantics
01h 06mThe Hidden Secrets of Move Semantics
01h 02mBack To Basics: The Special Member Functions
01h 10mAn Overview of C++11/14, Part II
04m(don't) Copy Paste All The Things
01h 06mThe Canonical Class
01h 01mException-Safe Code, Part I
24mMove Constructors: Is it Possible?
