2 ms·
If your codebase supports C++20, then std::bind_front, std::bind_back are superior alternatives. Among other things, you then no longer need to use the _1, _2,
by vitus 3y ago
If your codebase supports C++20, then std::bind_front, std::bind_back are superior alternatives. Among other things, you then no longer need to use the _1, _2, ... placeholders if you want partial function application.
But surely GP cannot be talking about std::bind in the context of
> Ever since C++ got lambdas, I would say that bind should be considered deprecated
since both came about in C++11.
Given the context of the article, GP is most likely talking about boost::bind, which was intended as a replacement API for std::bind1st, std::bind2nd (which were deprecated in C++11 and removed in C++17), and largely fills the same niche that std::bind does (except with surprisingly many caveats / differences between the two).