aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2022-04-28 13:33:57 +0200
committerJon Atack <jon@atack.com>2022-04-28 20:34:43 +0200
commite5485e8e4be7f2ee0671f58c3dcce35c68ba0ee0 (patch)
tree0aa75159fb49606730d74080140f224ed4c8b01a /src/bench
parentabc1ee509025d92db5311c3f5df3b61c09cad24f (diff)
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
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/checkqueue.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bench/checkqueue.cpp b/src/bench/checkqueue.cpp
index d7b8c1badc..53591f8905 100644
--- a/src/bench/checkqueue.cpp
+++ b/src/bench/checkqueue.cpp
@@ -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