Back to Basics: Move Semantics
summary
Covers exactly how rvalue references and std::move turn expensive copies into cheap transfers, when the compiler auto-generates move ctor/assign or deletes them, and why move ops must be explicitly noexcept. Shows concrete code patterns: writing move constructors/assignments with std::exchange, leaving moved-from objects valid (ideally default-constructed), adding self-assignment checks, preferring =default when safe, and the performance benefits for containers and move-only types like unique_ptr.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 0:20The Standard Library
- 1:51Assignment Operator
- 5:30L vs R Values
- 9:32Guidelines
- 12:44StandedMove
- 16:43Dont StandedMove
- 18:45Move Constructors Move Assignment Operators
- 21:40Move Constructors
- 27:01Move Assignment Operators
- 31:05Move from Object
- 35:14Move Selfassignment
- 37:31Rule of Five
- 40:04Universal References
- 42:13Move Only Types
- 43:53Resources
- 44:44Move Summary
- 45:22Benefits
- 45:39Questions
- 51:01Related Questions
related talks
42mThe Nightmare of Move Semantics for Trivial C++ Classes
33mMove Semantics for Nim
01h 03mC++ Trivial Relocation Through Time
48mTo Pass and Return — The Story of Functions, Values and Compilers
49mBack to Basics: Type Erasure
37mC++ Zero Overhead Pass by Value Through Invocable C++ Abstractions
01h 41mC++ Type Erasure Demystified
01h 01mEasy to Use, Hard to Misuse: Declarative Style in C++
