Unverified Commit d5d28bcb authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

use fmt::format() for error_stats output.

parent 9c3d108b
Loading
Loading
Loading
Loading
+3 −12
Original line number Original line Diff line number Diff line
@@ -47,16 +47,7 @@ double ErrorStats::dev() const


std::ostream &operator<<(std::ostream &out, const ErrorStats &stats)
std::ostream &operator<<(std::ostream &out, const ErrorStats &stats)
{
{
    const std::ios_base::fmtflags flags = out.flags();
    out << fmt::format("Average: {:10.3e} StdDev: {:10.3e} MaxErr: {:10.3e} @ item: {}",
    const std::streamsize width         = out.width(10);
                       stats.avg(), stats.dev(), stats.max(), stats.idx());
    const std::streamsize prec          = out.precision(3);
    return out;

    out << std::scientific << "Average: " << stats.avg() << " StdDev: " << stats.dev()
        << " MaxErr: " << stats.max();

    out.precision(prec);
    out.width(width);
    out.flags(flags);

    return out << " @ item: " << stats.idx();
}
}