The Many Variants of std::variant
summary
History of std::variant focuses on concrete design decisions not slogans: the final C++17 variant implements an empty state on assignment failure with a heap backup strategy to preserve the basic exception guarantee, chooses comparisons by alternative then value to preserve transitivity, and uses visitation as the O(1) access pattern absent language support. Multiple proposals, polls and thousands of emails shape tradeoffs among space, runtime and compile-time costs; the library solution lands and ships.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 9:46Designing C++ features
- 23:40Boost variant history
- 31:55Low-latency trading variant
- 34:03C++17 variant collaboration
- 42:11Evaluating C++17 proposals
- 51:02Finalizing C++17 variant
- 57:05Closing thoughts
related talks
59mstd variant and the power of pattern matching
01h 01mC++ Design Patterns - The Most Common Misconceptions (2 of N)
59mFunctional Programming: data
49mA Journey Into Non-Virtual Polymorphism in C++
48mBack to Basics: Cpp Value Semantics
01h 01mUsing Modern C++ to Eliminate Virtual Functions
01h 01mEmbracing (and also Destroying) Variant Types Safely
46mFive Issues with std::expected and How to Fix Them
