File indexing completed on 2025-01-30 10:02:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef CATCH_REPEAT_HPP_INCLUDED
0011 #define CATCH_REPEAT_HPP_INCLUDED
0012
0013 #include <type_traits>
0014 #include <catch2/internal/catch_move_and_forward.hpp>
0015
0016 namespace Catch {
0017 namespace Benchmark {
0018 namespace Detail {
0019 template <typename Fun>
0020 struct repeater {
0021 void operator()(int k) const {
0022 for (int i = 0; i < k; ++i) {
0023 fun();
0024 }
0025 }
0026 Fun fun;
0027 };
0028 template <typename Fun>
0029 repeater<std::decay_t<Fun>> repeat(Fun&& fun) {
0030 return { CATCH_FORWARD(fun) };
0031 }
0032 }
0033 }
0034 }
0035
0036 #endif