Product Types for C++2x
summary
Argues for a small, concrete API to treat arrays pairs tuples and aggregates uniformly so generic algorithms can tuple-like access elements, use C++17 fold expressions and index_sequence, and construct results via a generic make factory. Shows existing tooling (structured bindings, std::apply, template argument deduction for constructors) and libraries (Boost.Fusion, Hana, scatter) implementing swaps transforms folds and concat, notes proposals for literal pack types and operator expansion, and states some pieces work now while others remain unstandardized.
AI-written summary · about
chapters (29)
- 0:00Introduction
- 0:33Agenda
- 1:17Implementation
- 3:20Prototypes
- 4:04Type constructors
- 4:52Access
- 5:48Macros
- 7:06Extract
- 10:41Generic Algorithms
- 11:09Prototype
- 11:27Pack Types
- 12:28Pattern Matching
- 15:46Packs
- 17:03Operators
- 18:47Slice
- 19:23Prototyping
- 20:22Generate
- 21:41A Prototype
- 28:52Overloaded Functions
- 33:01Generic Lambda
- 33:51Prototype Access
- 34:57Prototypes from Functions
- 38:33Transfer Chain
- 39:08Flattening
- 40:54Transform
- 44:32Unique
- 49:10Cash
- 50:24Scattered
- 52:32File variants
related talks
01h 10mThe Three Little Dots and the Big Bad Lambdas
55mThe Curiously Recurring Pattern of Coupled Types
01h 01mApplicative: The Forgotten C++ Functional Pattern
01h 02mC++20 - My Favorite Code Examples
01h 03mWriting sustainable software. The how and the what!
58mThe Imperatives Must Go! [Functional Programming in Modern C++]
59mC++20: the small things
01h 09mFunctional Programming in C++
