Summary
This episode explores the concept of creating C++ lambdas on the heap rather than on the stack. Jason explains how lambdas are closure objects generated by the compiler and demonstrates the challenges of heap-allocating them. He reveals that lambdas without captures can be constructed on the heap, but lambdas with captures lack default constructors, making direct heap allocation impossible. The episode concludes with alternatives, including moving an existing lambda to the heap or creating a custom callable class directly on the heap.