Recursive lambdas in C++
·1448 words·7 mins
There are algorithms that have a natural recursive representation and are very cumbersome or painful to write iteratively. With the advent of lambda expressions in C++11, it seemed only natural that they should support recursive calls. But reality hit hard: recursion and lambdas didn’t mix at all until C++14, and even then the support was far from programmer-friendly. The newest C++ edition finally brings the possibility of creating a recursive lambda to the table.
More ...