Replace boost::variant with std::variant #20480
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2011-noBoostVariant changing 16 files +56 −66-
MarcoFalke commented at 5:32 pm on November 24, 2020: memberNow that we can use std::variant from the vanilla standard library, drop the third-party boost variant dependency
-
MarcoFalke added the label Refactoring on Nov 24, 2020
-
MarcoFalke force-pushed on Nov 24, 2020
-
DrahtBot commented at 7:44 pm on November 24, 2020: member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #20832 (rpc: Better error messages for invalid addresses by eilx2)
- #18194 (Bugfix: GUI: Remove broken ability to edit the address field in the sending address book by luke-jr)
- #15294 ([moveonly] wallet: Extract RipeMd160 by Empact)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
-
practicalswift commented at 8:02 pm on November 24, 2020: contributorConcept ACK
-
in src/rpc/util.cpp:212 in faccd6d836 outdated
209@@ -209,65 +210,52 @@ CTxDestination AddAndGetMultisigDestination(const int required, const std::vecto 210 return dest; 211 } 212 213-class DescribeAddressVisitor : public boost::static_visitor<UniValue>
promag commented at 11:23 pm on November 25, 2020:Have you considered the “overload” approach from https://en.cppreference.com/w/cpp/utility/variant/visit (looks like it may be included in c++20, https://wg21.link/P0051)?
MarcoFalke commented at 8:33 am on November 26, 2020:That’d be dangerous because it allows for implicit conversions and non-exhaustive visitors. Bugs like #17924 would be harder to find if the overload approach was used.
promag commented at 9:08 am on November 26, 2020:Understood, thanks for the explanation.promag commented at 11:23 pm on November 25, 2020: memberConcept ACK.MarcoFalke force-pushed on Nov 26, 2020RandyMcMillan commented at 3:47 pm on November 26, 2020: contributorConcept ACK :)theStack commented at 11:24 pm on November 26, 2020: memberConcept ACK 🚀jonasschnelli commented at 10:46 am on December 1, 2020: contributorConcept ACKlaanwj commented at 12:56 pm on December 3, 2020: memberConcept ACKMarcoFalke force-pushed on Dec 21, 2020in src/rpc/util.cpp:213 in fa1b3b6419 outdated
209@@ -209,65 +210,52 @@ CTxDestination AddAndGetMultisigDestination(const int required, const std::vecto 210 return dest; 211 } 212 213-class DescribeAddressVisitor : public boost::static_visitor<UniValue> 214-{ 215-public: 216- explicit DescribeAddressVisitor() {} 217+constexpr auto DescribeAddressVisitor = [](const auto& dest) -> UniValue {
fjahr commented at 1:15 pm on January 1, 2021:Could you comment on why you chose to change the approach here but not onDescribeWalletAddressVisitor
?
MarcoFalke commented at 11:34 am on January 4, 2021:No reason. Simplfied diff by using the same approach everywhere.fjahr commented at 1:17 pm on January 1, 2021: memberConcept ACK
Code looks good, I had started looking into similar changes before I found this.
MarcoFalke referenced this in commit bc8ada1c15 on Jan 4, 2021MarcoFalke force-pushed on Jan 4, 2021MarcoFalke force-pushed on Jan 4, 2021MarcoFalke force-pushed on Jan 4, 2021MarcoFalke force-pushed on Jan 4, 2021MarcoFalke commented at 3:00 pm on January 4, 2021: memberAddressed feedback by @fjahrsidhujag referenced this in commit 2e6fb6f50e on Jan 4, 2021in src/script/standard.h:12 in fa5ab4b7e4 outdated
8@@ -9,7 +9,7 @@ 9 #include <script/interpreter.h> 10 #include <uint256.h> 11 12-#include <boost/variant.hpp> 13+#include <variant>
fjahr commented at 10:51 pm on January 4, 2021:nit: could probably be sorted below string
MarcoFalke commented at 9:17 am on January 5, 2021:Thanks, sorted includesfjahr commented at 10:53 pm on January 4, 2021: memberCode review ACK fa5ab4b7e4f609a1309503e3b3c5317ebf81a7e9
Thanks, the simplifications made this very straight forward to review IMO.
Replace boost::variant with std::variant faa8f68943MarcoFalke force-pushed on Jan 5, 2021fjahr commented at 11:18 pm on January 5, 2021: memberCode review ACK faa8f68943615785a2855676cf96e0e96f3cc6bd
Only changes were sorting of includes and switching of
CTxDestination
from typedef to type alias.fanquake approvedfanquake commented at 4:05 am on January 11, 2021: memberACK faa8f68943615785a2855676cf96e0e96f3cc6bdfanquake merged this on Jan 11, 2021fanquake closed this on Jan 11, 2021
MarcoFalke deleted the branch on Jan 11, 2021sidhujag referenced this in commit 3b0248f814 on Jan 11, 2021MarkLTZ referenced this in commit 6de0d15f61 on Feb 16, 2021DrahtBot locked this on Aug 16, 2022
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 03:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me