Skip to content

Commit c5248f6

Browse files
committed
timer.h: template-ized Timer::run()
1 parent 575de99 commit c5248f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/timer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ class CPPCHECKLIB Timer {
9191

9292
void stop();
9393

94-
static void run(std::string str, ShowTime showtimeMode, TimerResultsIntf* timerResults, const std::function<void()>& f) {
94+
template <class TFunc>
95+
static void run(std::string str, ShowTime showtimeMode, TimerResultsIntf* timerResults, const TFunc& f) {
9596
Timer t(std::move(str), showtimeMode, timerResults);
9697
f();
9798
}

0 commit comments

Comments
 (0)