Getting ready

To demonstrate how to write a recursive lambda, we will consider the well-known example of the Fibonacci function. This is usually implemented recursively in C++, as follows:

    constexpr int fib(int const n) 
{
return n <= 2 ? 1 : fib(n - 1) + fib(n - 2);
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset