Comment by Kranar
> In fact, it has existed long before lambdas where introduced.
Both std::function<> and lambdas were introduced in C++11.
Furthermore absolutely no one should use std::bind, it's an absolute abomination.
> In fact, it has existed long before lambdas where introduced.
Both std::function<> and lambdas were introduced in C++11.
Furthermore absolutely no one should use std::bind, it's an absolute abomination.
You are absolutely right of course! No idea, why I thought std::function existed before C++11. Mea culpa!
> Furthermore absolutely no one should use std::bind, it's an absolute abomination.
Agree 100%! I almost always use a wrapper lambda.
However, it's worth pointing out that C++20 gave us std::bind_front(), which is really useful if you want to just bind the first N arguments:
I think std::bind_front() is the clear winner here.