Prefer lambda expressions over std::bind#17090
Conversation
|
8434790 to
e08a2b3
Compare
|
|
1 similar comment
|
|
|
|
1 similar comment
|
src/cpp/client/secure_credentials.cc
Outdated
| w->thread_pool_->Add( | ||
| std::bind(&MetadataCredentialsPluginWrapper::InvokePlugin, w, context, | ||
| cb, user_data, nullptr, nullptr, nullptr, nullptr)); | ||
| w->thread_pool_->Add([=]() { |
There was a problem hiding this comment.
The empty () are unnecessary and can be left out.
| w->thread_pool_->Add([=]() { | |
| w->thread_pool_->Add([=] { |
Same thing below.
There was a problem hiding this comment.
But see my overall request about anonymous captures.
vjpai
left a comment
There was a problem hiding this comment.
IMMEDIATE LBTM.
We cannot use anonymous lambda captures.
|
@vjpai Why can't we use anonymous lambda captures? |
|
Anonymous lambda captures are error-prone and imprecise; although people say that about |
|
|
|
|
|
All green! Thanks for reviewing! |
|
@vjpai Thanks for the explanation! Makes sense. |
Prefer lambda expressions over std::bind.
Fixes #17048