diff options
author | W. J. van der Laan <laanwj@protonmail.com> | 2021-03-31 19:56:56 +0200 |
---|---|---|
committer | W. J. van der Laan <laanwj@protonmail.com> | 2021-03-31 20:17:39 +0200 |
commit | 602b038d433b8f35116c7149175bba191f690bb6 (patch) | |
tree | 28fd80b938f2f0c07a5619095ee4ede2215ad655 /src/init.cpp | |
parent | b14462083f82aeaa9a376978f210db5538db296f (diff) | |
parent | 916ab0195d567fd0a9097045e73a6654c453adea (diff) |
Merge #21366: refactor: replace util::Ref with std::any (C++17)
916ab0195d567fd0a9097045e73a6654c453adea remove unused class util::Ref and its unit test (Sebastian Falbesoner)
8dbb87a3932f81e23ba7afd865b9aeeb535f0c20 refactor: replace util::Ref by std::any (C++17) (Sebastian Falbesoner)
95cccf8a4b392959c1fd7ec0647e04eb13880865 util: introduce helper AnyPtr to access std::any instances (Sebastian Falbesoner)
Pull request description:
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).
ACKs for top commit:
hebasto:
re-ACK 916ab0195d567fd0a9097045e73a6654c453adea, with command
ryanofsky:
Code review ACK 916ab0195d567fd0a9097045e73a6654c453adea. Changes since last review: rebase and replacing types with `auto`. I might have used `const auto*` and `auto*` instead of plain `auto` because I think the qualifiers are useful, but this is all good.
Tree-SHA512: fe2c3e4f5726f8ad40c61128339bb24ad11d2c261f71f7b934b1efe3e3279df14046452b0d9b566917ef61d5c7e0fd96ccbf35ff810357e305710f5002c27d47
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/init.cpp b/src/init.cpp index 8b1f531b81..17b216573f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -788,7 +788,7 @@ static bool InitSanityCheck() return true; } -static bool AppInitServers(const util::Ref& context, NodeContext& node) +static bool AppInitServers(const std::any& context, NodeContext& node) { const ArgsManager& args = *Assert(node.args); RPCServer::OnStarted(&OnRPCStarted); @@ -1277,7 +1277,7 @@ bool AppInitInterfaces(NodeContext& node) return true; } -bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) +bool AppInitMain(const std::any& context, NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) { const ArgsManager& args = *Assert(node.args); const CChainParams& chainparams = Params(); |