Hi
I googled and tried to run a recursive lambda in interpreter mode of ROOT6 but I failed.
It was okay when compiled.
Could you give me any idea?
Thank you.
#include <iostream>
int main() {
// From here
std::function<int(int)> factorial;
factorial = [&factorial](int n) -> int
{
if (0 == n)
return 1;
else
return n * factorial(n - 1);
};
std::cout << factorial(5) << std::endl;
// To here
return 0;
}