int main(){ std::function<void(double, double, double)> f = foo; auto t = bind_first(f, 10); t(1, 2); t(5, 6); auto w = bind_first(t, 20); w(1024); w(3.14); }
Proxy_Function fun(T t, const Q &q, const R &r) { return fun(bind_first(bind_first(t, q), r)); }
Proxy_Function fun(T t, const Q &q) { return fun(bind_first(t, q)); }
std::function<R (Types...)> bind_first(std::function<R (T, Types...)> f, U val) { return bind_first(f, val, std::make_integer_sequence<int, sizeof...(Types)>()); }
auto bind_first(const F &f, O &&o) { return bind_first(f, std::forward<O>(o), &F::operator()); }