> 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