/*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#ifndef BENCHMARK_IMPL_H_
-#define BENCHMARK_IMPL_H_
+
+#pragma once
#include <functional>
+#include <folly/Function.h>
+
class TestClass;
class VirtualClass;
void BM_fn_ptr_invoke_impl(int iters, void (*fn)());
void BM_std_function_invoke_impl(int iters, const std::function<void()>& fn);
+void BM_Function_invoke_impl(int iters,
+ const folly::Function<void() const>& fn);
void BM_mem_fn_invoke_impl(int iters,
TestClass* tc,
void (TestClass::*memfn)());
// Invoke a function object as a template parameter.
// This can be used to directly invoke lambda functions
-template<typename T>
+template <typename T>
void BM_invoke_fn_template_impl(int iters, const T& fn) {
for (int n = 0; n < iters; ++n) {
fn();
}
}
-
-#endif // BENCHMARK_IMPL_H_