std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ep = std::make_exception_ptr(e);
- assert(ep);
+ bool b = static_cast<bool>(ep);
+ folly::doNotOptimizeAway(b);
}
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
- assert(ew);
+ bool b = static_cast<bool>(ew);
+ folly::doNotOptimizeAway(b);
}
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ep = std::make_exception_ptr(e);
- assert(ep);
+ bool b = static_cast<bool>(ep);
+ folly::doNotOptimizeAway(b);
}
});
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
- assert(ew);
+ bool b = static_cast<bool>(ew);
+ folly::doNotOptimizeAway(b);
}
});
}
auto ep = std::make_exception_ptr(e);
try {
std::rethrow_exception(ep);
- assert(false);
} catch (std::runtime_error&) {
}
}
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
try {
ew.throwException();
- assert(false);
} catch (std::runtime_error&) {
}
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
- assert(ew.is_compatible_with<std::runtime_error>());
+ bool b = ew.is_compatible_with<std::runtime_error>();
+ folly::doNotOptimizeAway(b);
}
}
auto ep = std::make_exception_ptr(e);
try {
std::rethrow_exception(ep);
- assert(false);
} catch (std::runtime_error&) {
}
}
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
try {
ew.throwException();
- assert(false);
} catch (std::runtime_error&) {
}
}
std::runtime_error e("payload");
for (size_t i = 0; i < iters; ++i) {
auto ew = folly::make_exception_wrapper<std::runtime_error>(e);
- assert(ew.is_compatible_with<std::runtime_error>());
+ bool b = ew.is_compatible_with<std::runtime_error>();
+ folly::doNotOptimizeAway(b);
}
});
}