std::function<> is a useful wrapper around almost any callable thing, including free functions, lambdas, functors, member functions, results from st
class multi_functor
{
public:
void operator()(int) { std::cout << "i'm int" << std::endl }
void operator()(double) { std::cout << "i'm double" << std::endl }
};
int main(void)
{
auto func = make_function(multi_functor());
}
Because what would be the type of func here ?
This ambiguity applies to all functor objects (which includes bind return values and lambdas), which would make make_function only usable on function pointers.