Struct BenchmarkStats

Synopsis

#include <include/internal/catch_interfaces_reporter.h>

template <class Duration>
struct BenchmarkStats

Description

No description yet.

Methods

operator BenchmarkStats< Duration2 >

Source

Lines 179-203 in include/internal/catch_interfaces_reporter.h.

template <class Duration>
struct BenchmarkStats {
    BenchmarkInfo info;
    std::vector<Duration> samples;
    Benchmark::Estimate<Duration> mean;
    Benchmark::Estimate<Duration> standardDeviation;
    Benchmark::OutlierClassification outliers;
    double outlierVariance;
    template <typename Duration2>
    operator BenchmarkStats<Duration2>() const {
        std::vector<Duration2> samples2;
        samples2.reserve(samples.size());
        std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); });
        return {
            info,
            std::move(samples2),
            mean,
            standardDeviation,
            outliers,
            outlierVariance,
        };
    }
};





Add Discussion as Guest

Log in