c++: Declare function inside of function call
c++, function-pointers
Solution
You can use lambdas for that:
std::equal(arr1, arr1 + 5, arr2, [](double a, double b) { return a == -b; });
Problem
Is it possible to pass a function definition as an arguement and if so what is the syntax for that? If it is not, what would be the reason? I would like to do something like: ``` double arr1[10], arr2[10]; std::equal(arr1, &(arr1[5]), arr2, (bool(*)(double a, double b){return a == -b;}); ```