HomePhabricator

scheduler: Capture ‘this’ explicitly in lambda

Description

scheduler: Capture ‘this’ explicitly in lambda

Summary:
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 is a partial backport of core#24169
https://github.com/bitcoin/bitcoin/pull/24169/commits/fae2220f4e48934313389864d3d362f672627eb8

Depends on D15314

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D15315

Details

Provenance
MarcoFalke <falke.marco@gmail.com>Authored on Mar 17 2022, 20:24
PiRKCommitted on Jan 30 2024, 15:42
PiRKPushed on Jan 30 2024, 15:42
Reviewer
Restricted Project
Differential Revision
D15315: scheduler: Capture ‘this’ explicitly in lambda
Parents
rABCf08a557cddcf: [e.cash] add style rule for blog code blocks
Branches
Unknown
Tags
Unknown