Skip to content

Commit c0b6ace

Browse files
committed
More doNotOptimize
1 parent def5595 commit c0b6ace

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bench.hpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,15 @@ class Bench
8181
void pop(value_type expected) {
8282
value_type val;
8383
if constexpr(isRigtorp<T>::value) {
84-
while (!q.front()) {}
84+
while (auto again = not q.front()) {
85+
doNotOptimize(again);
86+
}
8587
val = *q.front();
8688
q.pop();
8789
} else {
88-
while (not q.pop(val)) {}
90+
while (auto again = not q.pop(val)) {
91+
doNotOptimize(again);
92+
}
8993
}
9094
if (val != expected) {
9195
throw std::runtime_error("invalid value");

0 commit comments

Comments
 (0)