aboutsummaryrefslogtreecommitdiff
path: root/src/prevector.h
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2022-04-28 20:20:30 +0200
committerJon Atack <jon@atack.com>2022-04-28 20:22:56 +0200
commitabc1ee509025d92db5311c3f5df3b61c09cad24f (patch)
treec6df42ecc03adaf63c41af136344b03a02bb0c53 /src/prevector.h
parent8730bd3fc87c8a7d44347267e1ff3c7a8674201b (diff)
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/prevector.h')
-rw-r--r--src/prevector.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/prevector.h b/src/prevector.h
index aa20efaaa7..830b31e315 100644
--- a/src/prevector.h
+++ b/src/prevector.h
@@ -458,7 +458,8 @@ public:
return *item_ptr(size() - 1);
}
- void swap(prevector<N, T, Size, Diff>& other) {
+ void swap(prevector<N, T, Size, Diff>& other) noexcept
+ {
std::swap(_union, other._union);
std::swap(_size, other._size);
}