Remove obsolete NODISCARD ifdef forest. Use [[nodiscard]] (C++17).
Remove obsolete NODISCARD ifdef forest. Use [[nodiscard]] (C++17). #20499
pull practicalswift wants to merge 2 commits into bitcoin:master from practicalswift:remove-nodiscard-cruft changing 18 files +54 −67-
practicalswift commented at 9:56 PM on November 25, 2020: contributor
- fanquake added the label Refactoring on Nov 26, 2020
-
fanquake commented at 4:02 AM on November 26, 2020: member
Now that the ifdef forest is removed, is there an advantage to redefining
[[nodiscard]]asNODISCARDrather than just using[[nodiscard]]directly where applicable? -
4848e71107
scripted-diff: Use [[nodiscard]] (C++17) instead of NODISCARD
-BEGIN VERIFY SCRIPT- sed -i "s/NODISCARD/[[nodiscard]]/g" $(git grep -l "NODISCARD" ":(exclude)src/bench/nanobench.h" ":(exclude)src/attributes.h") -END VERIFY SCRIPT-
-
Remove NODISCARD 79bff8e48a
- practicalswift force-pushed on Nov 26, 2020
-
practicalswift commented at 9:13 AM on November 26, 2020: contributor
@fanquake No, not at all: I just wanted to keep the diff down. But you have a good point: using
[[nodiscard]]directly is certainly nicer and more idiomatic, so it is probably worth the one time cost of a few extra lines of diff. Now doing that using a scripted-diff :) -
DrahtBot commented at 2:53 PM on November 26, 2020: member
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #20457 (util: Make Parse{Int,UInt}{32,64} use locale independent std::from_chars(…) (C++17) instead of locale dependent strto{l,ll,ul,ull} by practicalswift)
- #20383 (Avoid signed integer overflow and invalid integer negation when loading malformed mempool.dat files by practicalswift)
- #14866 ([wip] util: Improve evaluation of includeconf lines in network sections of the config file by AkioNak)
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.
- theStack approved
-
theStack commented at 4:57 PM on November 29, 2020: member
ACK 79bff8e48aca961ec271b0d592aca9278b981e2f Checked that all instances of NODISCARD were tackled. It's always nice to see when old cruft is removed 👍
- fanquake approved
-
fanquake commented at 1:29 PM on November 30, 2020: member
ACK 79bff8e48aca961ec271b0d592aca9278b981e2f
- MarcoFalke merged this on Nov 30, 2020
- MarcoFalke closed this on Nov 30, 2020
- sidhujag referenced this in commit 888cabec95 on Nov 30, 2020
- MarkLTZ referenced this in commit 78c81d94e4 on Feb 16, 2021
- practicalswift deleted the branch on Apr 10, 2021
- kittywhiskers referenced this in commit ee13fbc81d on Jun 15, 2021
- kittywhiskers referenced this in commit f735b2061c on Jun 15, 2021
- kittywhiskers referenced this in commit 144086f8d3 on Jun 16, 2021
- kittywhiskers referenced this in commit 43d1cbee44 on Jun 25, 2021
- kittywhiskers referenced this in commit 7258a700a4 on Jun 25, 2021
- kittywhiskers referenced this in commit 3b2bbdcda2 on Jun 27, 2021
- kittywhiskers referenced this in commit f2f1843f0c on Jun 27, 2021
- UdjinM6 referenced this in commit 7d664c7c53 on Jun 27, 2021
- Fabcien referenced this in commit f192773f33 on Jan 26, 2022
- gades referenced this in commit 4f580ab9b5 on Apr 29, 2022
- MarcoFalke referenced this in commit 66e3b16b8b on May 23, 2022
- sidhujag referenced this in commit ec3c4daa31 on May 28, 2022
- DrahtBot locked this on Aug 16, 2022