How can currying be done in C++?
问题 What is currying? How can currying be done in C++? Please Explain binders in STL container? 回答1: In short, currying takes a function f(x, y) and given a fixed Y , gives a new function g(x) where g(x) == f(x, Y) This new function may be called in situations where only one argument is supplied, and passes the call on to the original f function with the fixed Y argument. The binders in the STL allow you to do this for C++ functions. For example: #include <functional> #include <iostream> #include