Deducing this Patterns
summary
C++23 adds P0847 "Deducing this", making the implicit object parameter explicit and deducible so member functions learn the static most‑derived type and value category. Examples show getters that auto-generate all cv/ref overloads, builder chaining where CRTP disappears, lambdas that name their closure and enable recursive lambdas, and by‑value this allowing safe moves through computations. Code is exercised on Circle/Godbolt and the paper passes plenary, so the feature is implemented and usable in compilers that follow the proposal.
AI-written summary · about
chapters (17)
- 0:00Start
- 2:14Origin Story
- 10:29Getter
- 17:44Builder Pattern
- 19:07No Class Templates
- 29:22Sphenae Friendly Callable Objects
- 32:29Lambdas
- 33:04The Lambda Expression
- 35:30Recursive Lambda
- 38:59Lambda Expressions
- 46:54The Template Method
- 47:56Template Method Pattern
- 48:37Method with an Explicit Object Parameter
- 53:00Advantages and Disadvantages
- 54:22Disadvantages
- 56:13Conclusion
- 57:18Questions
related talks
46mEmbracing CTAD
48mWhat is a static function but isn't a static function
06mConstructor Template Argument Deduction Best Practices
01h 05mExpressing Implementation Sameness and Similarity - Polymorphism in Modern C++
49mA Journey Into Non-Virtual Polymorphism in C++
55mThe Curiously Recurring Pattern of Coupled Types
01h 01mC++ Design Patterns - The Most Common Misconceptions (2 of N)
48mBack to Basics: Cpp Value Semantics
