@@ -44,33 +44,6 @@ void timer(int part, F func, Args &&...args) {
44
44
std::cout << std::format (" Part {} answer: {:<20}{:>20}\n " , part, result, duration_string);
45
45
}
46
46
47
- // template <typename T, typename U>
48
- // void timer(int part, T (*func)(const U &), U data, bool show_res = true) {
49
- // auto t1 = Clock::now();
50
- // T result = func(data);
51
- // auto t2 = Clock::now();
52
-
53
- // const std::string duration_string = convert_duration(t2 - t1);
54
- // if (show_res) {
55
- // std::cout << std::format("Part {} answer: {:<20}{:>20}\n", part, result, duration_string);
56
- // } else {
57
- // std::cout << std::format("Time elapsed : {:>40}\n", duration_string);
58
- // }
59
- // }
60
-
61
- // template <typename T, typename U, typename W>
62
- // void timer(int part, T (*func)(U &, W), U data, W data2, bool show_res = true) {
63
- // auto t1 = Clock::now();
64
- // T result = func(data, data2);
65
- // auto t2 = Clock::now();
66
- // const std::string duration_string = convert_duration(t2 - t1);
67
- // if (show_res) {
68
- // std::cout << std::format("Part {} answer: {:<20}{:>20}\n", part, result, duration_string);
69
- // } else {
70
- // std::cout << std::format("Time elapsed : {:>40}\n", duration_string);
71
- // }
72
- // }
73
-
74
47
template <typename F, typename U>
75
48
void timer (F func, U data) {
76
49
auto t1 = Clock::now ();
@@ -82,7 +55,7 @@ void timer(F func, U data) {
82
55
}
83
56
84
57
template <typename F, typename U>
85
- decltype (auto ) timer(F func, U data, std::string &&message) {
58
+ decltype (auto ) timer(F func, U data, const std::string &&message) {
86
59
auto t1 = Clock::now ();
87
60
auto result = func (data);
88
61
auto t2 = Clock::now ();
0 commit comments