diff options
author | MarcoFalke <falke.marco@gmail.com> | 2022-03-17 21:24:26 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2022-03-24 11:36:37 +0100 |
commit | fae2220f4e48934313389864d3d362f672627eb8 (patch) | |
tree | d255986d72a3056d0e81855ea83770466c827c72 /src | |
parent | 98e9d8e8e2e3e65e6f1e14be26457a9f9090c092 (diff) | |
download | bitcoin-fae2220f4e48934313389864d3d362f672627eb8.tar.xz |
scheduler: Capture ‘this’ explicitly in lambda
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
Diffstat (limited to 'src')
-rw-r--r-- | src/scheduler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scheduler.cpp b/src/scheduler.cpp index 0b2ad3c553..197d009f7c 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, |