Struct BenchmarkFunction

Nested Relationships

Nested Types

Struct Documentation

struct BenchmarkFunction

We need to reinvent std::function because every piece of code that might add overhead in a measurement context needs to have consistent performance characteristics so that we can account for it in the measurement. Implementations of std::function with optimizations that aren’t always applicable, like small buffer optimizations, are not uncommon. This is effectively an implementation of std::function without any such optimizations; it may be slow, but it is consistently slow.

Public Functions

inline BenchmarkFunction()
template<typename Fun, std::enable_if_t<!is_related<Fun, BenchmarkFunction>::value, int> = 0>
inline BenchmarkFunction(Fun &&fun)
inline BenchmarkFunction(BenchmarkFunction &&that) noexcept
inline BenchmarkFunction(BenchmarkFunction const &that)
inline BenchmarkFunction &operator=(BenchmarkFunction &&that) noexcept
inline BenchmarkFunction &operator=(BenchmarkFunction const &that)
inline void operator()(Chronometer meter) const