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
This commit is contained in:
Jon Atack
2022-04-28 20:20:30 +02:00
parent 8730bd3fc8
commit abc1ee5090
2 changed files with 4 additions and 2 deletions

View File

@@ -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);
}