mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-07 21:28:40 +02:00
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
This commit is contained in:
@@ -26,7 +26,7 @@ struct DumbCheck {
|
||||
return result;
|
||||
}
|
||||
|
||||
void swap(DumbCheck& x)
|
||||
void swap(DumbCheck& x) noexcept
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@@ -161,7 +161,7 @@ public:
|
||||
pre_vector.shrink_to_fit();
|
||||
}
|
||||
|
||||
void swap()
|
||||
void swap() noexcept
|
||||
{
|
||||
real_vector.swap(real_vector_alt);
|
||||
pre_vector.swap(pre_vector_alt);
|
||||
|
||||
Reference in New Issue
Block a user