My Temporary Materialization Misconception
summary
Sees C++17 elision failing: constructing a vector of unique_ptr<Dispatcher> triggers many unexpected move (and sometimes copy) constructor calls when objects are created with make_unique with perfect forwarding. Reproduces with a non-copyable dispatcher type with complex move semantics, isolates the culprit to temporary materialization that happens on binding a reference to a prvalue, and notes P527 as a possible future fix.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:38Temporary Materialization - what it is
- 1:15C++17 Value Categories
- 3:26Let's go simple
- 4:13When does materialization occur?
- 4:51Don't do what I did, do as they say
related talks
39mTemporal Dynamics - Exploring the Intricacies of Object Lifetimes in Modern C++
01h 13mNothing is better than copy or move
01h 23mRethink Polymorphism in C++
55mBreaking Dependencies: Type Erasure - The Implementation Details
39mTemporal Dynamics - Exploring the Intricacies of Object Lifetimes in Modern C++
36mInterfaces Matter
01h 11mI just wanted to point to something!
01h 33mSafe and Sane C++ Types
