From fae2220f4e48934313389864d3d362f672627eb8 Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Thu, 17 Mar 2022 21:24:26 +0100 Subject: [PATCH] =?UTF-8?q?scheduler:=20Capture=20=E2=80=98this=E2=80=99?= =?UTF-8?q?=20explicitly=20in=20lambda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the changes, g++ will warn to compile under C++20: scheduler.cpp:114:21: warning: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Wdeprecated] 114 | scheduleFromNow([=] { Repeat(*this, f, delta); }, delta); | ^ scheduler.cpp:114:21: note: add explicit ‘this’ or ‘*this’ capture --- src/scheduler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scheduler.cpp b/src/scheduler.cpp index 0b2ad3c5536..197d009f7cb 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -111,7 +111,7 @@ static void Repeat(CScheduler& s, CScheduler::Function f, std::chrono::milliseco void CScheduler::scheduleEvery(CScheduler::Function f, std::chrono::milliseconds delta) { - scheduleFromNow([=] { Repeat(*this, f, delta); }, delta); + scheduleFromNow([this, f, delta] { Repeat(*this, f, delta); }, delta); } size_t CScheduler::getQueueInfo(std::chrono::system_clock::time_point& first,