A problem passing functions from std as a function parameter
I’m trying to figure out how to pass an std function as a parameter. Here is a brief example: #include <cmath> #include <functional> #include <iostream> void bar(const double v, std::function<int(int)> foo) { std::cout << foo(v) << std::endl; } int main() { bar(-23., std::abs); } This code fails to compile with a message no matching function… Read More A problem passing functions from std as a function parameter