Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Replace bind with lambda #1498
I propose to replace all binds with lambdas. As of C++14 there isn't anything that std::bind does which lambdas can't do (that I know of). Lambdas are actually used throughout the code except notably in rai_secure.cpp. In addition to removing this construct entirely from the codebase, it keeps the asio callbacks more consistent.
As "Effective Modern C++ Item 34 - Prefer lambdas to std::bind" describes, to the uninitiated _1 essentially looks like magic (among other things). std::bind1st and std::bind2nd have been removed in C++17, and std::bind is set to follow suit. For more information about std::bind there is a handy section of this video by Stephan T Lavavej: