diff options
author | Jon Atack <jon@atack.com> | 2022-04-28 13:33:57 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2022-04-28 20:34:43 +0200 |
commit | e5485e8e4be7f2ee0671f58c3dcce35c68ba0ee0 (patch) | |
tree | 0aa75159fb49606730d74080140f224ed4c8b01a /src/bench/checkqueue.cpp | |
parent | abc1ee509025d92db5311c3f5df3b61c09cad24f (diff) | |
download | bitcoin-e5485e8e4be7f2ee0671f58c3dcce35c68ba0ee0.tar.xz |
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/checkqueue.cpp')
-rw-r--r-- | src/bench/checkqueue.cpp | 5 |
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 |