Skip to content

Commit 468f80e

Browse files
committed
Set lambda to be used if and only if benchmark is not skipped
1 parent 5260fd2 commit 468f80e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/catch2/benchmark/catch_benchmark.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ namespace Catch {
9595
// sets lambda to be used in fun *and* executes benchmark!
9696
template <typename Fun, std::enable_if_t<!Detail::is_related<Fun, Benchmark>::value, int> = 0>
9797
Benchmark & operator=(Fun func) {
98-
fun = Detail::BenchmarkFunction(func);
9998
auto const* cfg = getCurrentContext().getConfig();
10099
if (!cfg->skipBenchmarks()) {
100+
fun = Detail::BenchmarkFunction(func);
101101
run();
102102
}
103103
return *this;

0 commit comments

Comments
 (0)