diff options
author | Jon Atack <jon@atack.com> | 2022-04-28 20:20:30 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-04-28 20:22:56 +0200 |
commit | abc1ee509025d92db5311c3f5df3b61c09cad24f (patch) | |
tree | c6df42ecc03adaf63c41af136344b03a02bb0c53 /src/validation.h | |
parent | 8730bd3fc87c8a7d44347267e1ff3c7a8674201b (diff) | |
download | bitcoin-abc1ee509025d92db5311c3f5df3b61c09cad24f.tar.xz |
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
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/validation.h b/src/validation.h index e3ea8617e7..afc53bb445 100644 --- a/src/validation.h +++ b/src/validation.h @@ -328,7 +328,8 @@ public: bool operator()(); - void swap(CScriptCheck &check) { + void swap(CScriptCheck& check) noexcept + { std::swap(ptxTo, check.ptxTo); std::swap(m_tx_out, check.m_tx_out); std::swap(nIn, check.nIn); |