These 10 tricks that only library implementors know!
summary
Covers concrete library techniques: how empty base class optimization and the new no_unique_address attribute shave bytes from unique_ptr/tuple by avoiding stored empty deleters or allocators; how allocator::construct/destroy can change initialization behavior; how non-deduced contexts and decay/remove_cvref avoid accidental overloads; how optional/pair mirror wrapped type special-member and explicitness properties via conditional base classes; and how iterator_traits/tag-dispatch (and if constexpr with concepts) pick faster algorithms for random-access versus input iterators.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:38Trix
- 2:35Empty Base Classes
- 4:45No Unique Address
- 7:53No Unique Pointer
- 11:55Construct from Anything
- 13:41Constraints
- 19:08Template metaprogramming
- 25:59Common type trait
- 33:09Generic option
- 34:21Copy constructors
- 35:59Default constructors
- 38:39Copy constructor
- 40:39Special members
- 45:09Explicit constructors
- 51:29Unique pointers
related talks
56mCute C++ Tricks (and what you can learn from them): Part 2 of N
12mTraits Go Mainstream...
55mBreaking Dependencies: Type Erasure - The Implementation Details
57mSome Things C++ Does Right
01h 02mOn the benefits of non-intrusiveness
01h 39m“Leak-Freedom in C++... By Default.”
01h 33mSafe and Sane C++ Types
55mGreat C++ is_trivial
