validation: make CScriptCheck and prevector swap members noexcept #25017

pull jonatack wants to merge 2 commits into bitcoin:master from jonatack:swap-noexcept changing 7 files +27 −12
  1. jonatack commented at 5:33 pm on April 28, 2022: member

    along with those seen elsewhere in the codebase (prevector and checkqueue units/fuzz/bench).

    A swap must not fail; when a class has a swap member function, it should be declared noexcept. https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c84-a-swap-function-must-not-fail

  2. jonatack force-pushed on Apr 28, 2022
  3. DrahtBot added the label Validation on Apr 28, 2022
  4. laanwj commented at 5:43 pm on April 28, 2022: member
    Concept ACK. Do we have any other swap member functions?
  5. jonatack renamed this:
    validation: make the CScriptCheck::swap() member function `noexcept`
    validation: make CScriptCheck and prevector swap members noexcept
    on Apr 28, 2022
  6. validation: make CScriptCheck and prevector swap member functions noexcept
    Reason:
    A swap must not fail; when a class has a swap member function, it should be declared noexcept.
    https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c84-a-swap-function-must-not-fail
    abc1ee5090
  7. vincenzopalazzo approved
  8. test, bench: make prevector and checkqueue swap member functions noexcept
    Reason:
    A swap must not fail; when a class has a swap member function, it should be declared noexcept.
    https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c84-a-swap-function-must-not-fail
    e5485e8e4b
  9. jonatack force-pushed on Apr 28, 2022
  10. jonatack commented at 6:35 pm on April 28, 2022: member

    Concept ACK. Do we have any other swap member functions?

    Added the remaining ones found with git grep "void swap" and looking through git grep -C3 "std::swap" … critical code in one commit, and test/bench in a second one.

  11. w0xlt approved
  12. w0xlt commented at 11:37 am on May 2, 2022: contributor

    ACK https://github.com/bitcoin/bitcoin/pull/25017/commits/e5485e8e4be7f2ee0671f58c3dcce35c68ba0ee0

    These changes make the code conform to the C.85: Make swap noexcept directive.

  13. MarcoFalke merged this on May 2, 2022
  14. MarcoFalke closed this on May 2, 2022

  15. jonatack deleted the branch on May 2, 2022
  16. sidhujag referenced this in commit 503476c73a on May 2, 2022
  17. Fabcien referenced this in commit dfa3cc728d on Feb 28, 2023
  18. DrahtBot locked this on May 2, 2023

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-12-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me