clang-tidy: Enable modernize-avoid-bind check
The check finds uses of std::bind and boost::bind and replaces them
with lambdas.
Lambdas will use value-capture unless reference capture is explicitly
requested with std::ref or boost::ref.
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I4491650a46eaab1588474b26efc622e89232ef02
diff --git a/manager/lamptest/lamptest.hpp b/manager/lamptest/lamptest.hpp
index 1d9dd86..c7804c8 100644
--- a/manager/lamptest/lamptest.hpp
+++ b/manager/lamptest/lamptest.hpp
@@ -38,8 +38,8 @@
* @param[in] manager - reference to manager instance
*/
LampTest(const sdeventplus::Event& event, Manager& manager) :
- timer(event, std::bind(std::mem_fn(&LampTest::timeOutHandler), this)),
- manager(manager), groupObj(NULL)
+ timer(event, [this](auto&) { timeOutHandler(); }), manager(manager),
+ groupObj(NULL)
{
// Get the force update and/or skipped physical LEDs names from the
// lamp-test-led-overrides.json file during lamp