3 ms·
bind() is still the cleaner way to write it. Seeing std::bind tells me that the intention is to create a function that does nothing but call a second function
by jlarocco 9y ago
bind() is still the cleaner way to write it.
Seeing std::bind tells me that the intention is to create a function that does nothing but call a second function with certain parameters fixed.
A lambda expression is far more general, so when I see it I have to think about what it's doing. There's also a subtle implication that the author chose the more general technique for a reason. It'll raise the questions, "Why isn't this using std::bind()?", "Is there something else going on here?", etc.
Off hand, I can't think of a reason why the bind would be any less efficient than the lambda.