aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-01-04 09:07:01 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-01-04 09:07:38 +0100
commitbc8ada1c15345d14e324aee68488c8aa8a75cae0 (patch)
tree7e11c3b95deeb2390863bb23b0a97a6ef81d53ff /src/rpc/util.cpp
parentf52f427b8eece858844c395e47c378864acc242d (diff)
parentfa749fbea3cad64582f76f7a58cfcc0d91a97326 (diff)
downloadbitcoin-bc8ada1c15345d14e324aee68488c8aa8a75cae0.tar.xz
Merge #20736: rpc: Replace boost::variant with std::variant for RPCArg.m_fallback
fa749fbea3cad64582f76f7a58cfcc0d91a97326 rpc: Replace boost::variant with std::variant for RPCArg.m_fallback (MarcoFalke) Pull request description: Now that we can use std::variant from the vanilla standard library, drop the third-party boost variant dependency. Patch is split out from #20480. A step-by-step replacement is possible because we don't have our own `Variant` wrapper and the source code specifies `boost::variant` explicitly. I think a step-by-step replacement should be preferred, because it simplifies review. ACKs for top commit: fjahr: re-ACK fa749fbea3cad64582f76f7a58cfcc0d91a97326 Sjors: re-ACK fa749fbea3cad64582f76f7a58cfcc0d91a97326 Tree-SHA512: 5e3c12b7d535f73065b4afa8df0a488f78fb25d2234f5ecbf740e624db03a34c35fea100eb7d37e84741721310e6450b7fb4296a2207a7ed1fa24485b3650981
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r--src/rpc/util.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index 1b21587b6d..e377a80fbd 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2020 The Bitcoin Core developers
+// Copyright (c) 2017-2021 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -562,10 +562,10 @@ std::string RPCArg::GetName() const
bool RPCArg::IsOptional() const
{
- if (m_fallback.which() == 1) {
+ if (m_fallback.index() == 1) {
return true;
} else {
- return RPCArg::Optional::NO != boost::get<RPCArg::Optional>(m_fallback);
+ return RPCArg::Optional::NO != std::get<RPCArg::Optional>(m_fallback);
}
}
@@ -609,10 +609,10 @@ std::string RPCArg::ToDescriptionString() const
}
} // no default case, so the compiler can warn about missing cases
}
- if (m_fallback.which() == 1) {
- ret += ", optional, default=" + boost::get<std::string>(m_fallback);
+ if (m_fallback.index() == 1) {
+ ret += ", optional, default=" + std::get<std::string>(m_fallback);
} else {
- switch (boost::get<RPCArg::Optional>(m_fallback)) {
+ switch (std::get<RPCArg::Optional>(m_fallback)) {
case RPCArg::Optional::OMITTED: {
// nothing to do. Element is treated as if not present and has no default value
break;