Summary
This episode explores C++17's variadic 'using' declarations by extending the example from Episode 40 on inheriting from lambdas. Jason demonstrates how to overcome the limitation of having to write explicit 'using' declarations for each base class operator() when inheriting from multiple lambdas. By combining variadic templates, perfect forwarding, C++17's class template argument deduction, and deduction guides with the new variadic 'using' feature, he creates a flexible solution that can merge an arbitrary number of lambdas into a single class. This approach allows for automatic resolution of the correct overloaded operator() based on the arguments passed, even with lambdas that have unique capture requirements like non-copyable types.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[temp.variadic]75% match -
[temp.arg.explicit]64% match -
[temp.explicit]63% match -
[namespace.constraints]63% match -
[temp.res.general]50% match