Every time I need to use std::bind
, I end up using a lambda instead. So when should I use std::bind
? I just finished removing it from one codebase, and I found that lambdas were always simpler and clearer than std::bind
. Isn't std::bind
completely unnecessary? Shouldn't it be deprecated in the future? When should I prefer std::bind
to lambda functions? (There has to be a reason that it got into the standard at the same time as lambdas.)
I've also noticed that more and more people are familiar with lambdas (so they know what lambdas do). However, a lot fewer people are familiar with std::bind
and std::placeholders
.