From Jason Turner
Watch on YouTube

Summary

This episode builds on the previous one about custom comparators for containers, exploring how to use lambdas as comparators for associative containers like std::set. Jason explains the challenges of using lambdas in this context, including the inability to use lambdas directly as template arguments and the lack of default constructors for lambda types. He demonstrates various approaches to work around these limitations in both C++11/14 and C++17, showing the evolution of syntax from verbose to more concise with class template argument deduction.

Resources

Tags