From Jason Turner
Watch on YouTube

Summary

This episode introduces fold expressions, a powerful new feature in C++17 that simplifies operations on parameter packs. Jason compares the verbose workarounds needed in C++14 (using initializer lists and common_type) with the elegant syntax offered by fold expressions. He demonstrates several examples, including summing values, division, and calculating averages, highlighting how fold expressions can be expanded in different directions and combined with other operations. The episode serves as a foundation for exploring fold expressions in more depth in future episodes.

Resources

Tags