Answers for "how to call recursive lambda function with different paramters"

C++
0

cpp create lambda with recursion

std::function<int(int,int)> sum;
sum = [term,next,&sum](int a, int b)->int {
if(a>b)
    return 0;
else
    return term(a) + sum(next(a),b);
};
Posted by: Guest on May-22-2020

Code answers related to "how to call recursive lambda function with different paramters"

Browse Popular Code Answers by Language