0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

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
This commit is contained in:
MarcoFalke 2022-03-17 21:24:26 +01:00
parent 98e9d8e8e2
commit fae2220f4e
No known key found for this signature in database
GPG key ID: CE2B75697E69A548

View file

@ -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,