mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
rpc: Replace boost::variant with std::variant for RPCArg.m_fallback
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user