mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01: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:
@@ -39,7 +39,10 @@ static void CCheckQueueSpeedPrevectorJob(benchmark::Bench& bench)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
void swap(PrevectorJob& x){p.swap(x.p);};
|
||||
void swap(PrevectorJob& x) noexcept
|
||||
{
|
||||
p.swap(x.p);
|
||||
};
|
||||
};
|
||||
CCheckQueue<PrevectorJob> queue {QUEUE_BATCH_SIZE};
|
||||
// The main thread should be counted to prevent thread oversubscription, and
|
||||
|
||||
Reference in New Issue
Block a user