HomePhabricator

refactor: replace util::Ref with std::any (C++17)

Description

refactor: replace util::Ref with std::any (C++17)

Summary:

As described in util/ref.h: "This implements a small subset of the functionality in C++17's std::any class, and can be dropped when the project updates to C++17". For accessing the contained object of a std::any instance, a helper template function AnyPtr is introduced (thanks to ryanofsky).

Co-authored-by: Russell Yanofsky <russ@yanofsky.org>

This is a backport of core#21366 [1&2/3]
https://github.com/bitcoin/bitcoin/pull/21366/commits/95cccf8a4b392959c1fd7ec0647e04eb13880865
https://github.com/bitcoin/bitcoin/pull/21366/commits/8dbb87a3932f81e23ba7afd865b9aeeb535f0c20

Note: due to D1736, the context is sometimes wrapped in HTTPRPCRequestProcessor instead of being passed directly as a parameter

Depends on D11557

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Sebastian Falbesoner <sebastian.falbesoner@gmail.com>Authored on Mar 5 2021, 13:33
PiRKCommitted on Jun 3 2022, 11:39
PiRKPushed on Jun 3 2022, 11:39
Reviewer
Restricted Project
Differential Revision
D11551: refactor: replace util::Ref with std::any (C++17)
Parents
rABC6922a8e02b08: refactor: Improve use of explicit keyword
Branches
Unknown
Tags
Unknown