Lambda passed as parameter via std::function
specification for type safety.

```
#include <functional>
long reduce_rec(const long *A, long low, long
high,
const std::function<long(long,
long)>& op)
{
long result;
long n = high - low;
if (n == 0){
return 0;
}
else if(high - low == 1){
return A[low];
}
else{
long mid=(low+high)/2;
long a,b;
a = reduce_rec(A, low, mid, op);
b = reduce_rec(A, mid, high, op);
//result = a + b;
result = op(a,b); // lambda call here
}
return result;
}
int caller()
{
auto lambda = [](long a, long b){ return (a +
b) * (a - b); };
return reduce_rec(nullptr /*your data*/, 10,
1110, lambda);
}
```