qvec: implement Google Test formatter

This commit is contained in:
Eric Wasylishen 2021-10-11 12:55:06 -06:00
parent feb57abbe2
commit fe99d69d07
1 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,7 @@
#include <string>
#include <algorithm>
#include <array>
#include <ostream>
#include <fmt/format.h>
#include "common/mathlib.hh"
#include "common/cmdlib.hh"
@ -227,6 +228,11 @@ public:
constexpr auto end() const { return v.end(); }
constexpr auto cbegin() const { return v.cbegin(); }
constexpr auto cend() const { return v.cend(); }
// for Google Test
friend std::ostream& operator<<(std::ostream& os, const qvec<T, N>& v) {
return os << fmt::format("{}", v);
}
};
namespace qv