Issues applying std::bind recursively on a std::function
问题 Given a function f(x, y, z) we can bind x to 0, getting a function g(y, z) == f(0, y, z) . We can continue doing this and get h() = f(0, 1, 2) . In C++ syntax that would be #include <functional> #include <iostream> void foo(int a, long b, short c) { std::cout << a << b << c << std::endl; } int main() { std::function<void(int, long, short)> bar1 = foo; std::function<void(long, short)> bar2 = std::bind(bar1, 0, std::placeholders::_1, std::placeholders::_2); std::function<void(short)> bar3 = std