Summary
This episode is the third chapter in Jason's five-part Christmas class series on lambdas, focusing on practical applications. First, Jason reviews solutions to Chapter 2's homework on implementing higher-order functions in C++98 and comparing different pair implementations with regard to object lifetime and construction. Then, he introduces Chapter 3's theme of 'Utilizing Lambdas', recommending eight episodes on optimal function returns, lambdas in fold expressions, storage duration, compiler optimizations, and using lambdas as comparators. The episode concludes with a new homework assignment comparing two lambda implementations in fold expressions and their dramatically different code generation patterns.
Resources
- Watch Episode on YouTube
- Chapter 2 Answers on Compiler Explorer
- Chapter 3 Notes on Compiler Explorer
- Christmas Class 2019 Playlist
- Ep125: The Optimal Way to Return from a Function
- Ep132: Lambdas in Fold Expressions
- Ep61: Storage Duration With Lambdas
- Ep32: Lambdas For Free
- Ep93: Custom Comparators
- Ep94: Lambdas as Comparators
- Ep95: Transparent Comparators
- Ep96: Transparent Lambda Comparators