Adopt more C++17 features throughout the codebase
Change-Id: I31af421d8a977ba2aae23afcda289ff53230897f
diff --git a/tests/benchmarks/timed-execute.hpp b/tests/benchmarks/timed-execute.hpp
index 50bec30..b33873d 100644
--- a/tests/benchmarks/timed-execute.hpp
+++ b/tests/benchmarks/timed-execute.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2013-2020 Regents of the University of California.
+ * Copyright (c) 2013-2023 Regents of the University of California.
*
* This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
*
@@ -29,10 +29,10 @@
template<typename F>
time::nanoseconds
-timedExecute(const F& f)
+timedExecute(F&& f)
{
auto before = time::steady_clock::now();
- f();
+ std::invoke(std::forward<F>(f));
auto after = time::steady_clock::now();
return after - before;
}