Horizon
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Catch::Benchmark::Detail::BenchmarkFunction Struct Reference

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. More...

#include <catch_amalgamated.hpp>

Public Member Functions

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

Detailed Description

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.


The documentation for this struct was generated from the following file: