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:
parent
98e9d8e8e2
commit
fae2220f4e
1 changed files with 1 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue