From b4d06f041f27c793a31024c15b1d6865011df81a Mon Sep 17 00:00:00 2001 From: zhirenx Date: Tue, 18 Jun 2024 18:54:29 +0800 Subject: [PATCH] fix: change std::bind to lambda Change-Id: I5695f559ab403c28b3352d45e77f2a8b32b0f1f8 Signed-off-by: zhirenx --- baselib/utils/src/utils_timer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/baselib/utils/src/utils_timer.cpp b/baselib/utils/src/utils_timer.cpp index 56e50e5..5a6d977 100644 --- a/baselib/utils/src/utils_timer.cpp +++ b/baselib/utils/src/utils_timer.cpp @@ -55,14 +55,14 @@ void DoTimerProcess(TimerProc callback, const void *context) TimerHandle DslmUtilsStartPeriodicTimerTask(uint32_t interval, TimerProc callback, const void *context) { UtilsTimer &st = DelayedRefSingleton::GetInstance(); - uint32_t timerId = st.Register(std::bind(&DoTimerProcess, callback, context), interval, false); + uint32_t timerId = st.Register([callback, context]() { DoTimerProcess(callback, context); }, interval, false); return static_cast(timerId); } TimerHandle DslmUtilsStartOnceTimerTask(uint32_t interval, TimerProc callback, const void *context) { UtilsTimer &st = DelayedRefSingleton::GetInstance(); - uint32_t timerId = st.Register(std::bind(&DoTimerProcess, callback, context), interval, true); + uint32_t timerId = st.Register([callback, context]() { DoTimerProcess(callback, context); }, interval, true); return static_cast(timerId); } -- Gitee