From Jason Turner
Watch on YouTube

Summary

This episode builds on the previous one about std::bind by explaining why lambdas are almost always a better alternative in modern C++. Jason demonstrates three main disadvantages of std::bind compared to lambdas: it requires significantly more compile-time resources (up to 20% more RAM and compile time), it produces less efficient runtime code (as shown through instruction count comparisons), and it lacks the flexibility of lambdas when working with templates. The episode shows how to reimplement the same functionality from the previous episode's std::bind examples using C++11/14 lambdas, resulting in cleaner, more efficient, and more flexible code.

Resources

Tags