15template<
typename T0,
typename T1>
16requires(
requires (ostream &o, T0 t0, T1 t1) { o << t0; o << t1; })
17ostream &
operator<<(ostream &o,
const pair<T0, T1> &p) {
18 return o <<
'{' << p.first <<
", " << p.second <<
'}';
21template<
typename T,
size_t N>
22requires(
requires (ostream &o,
T t) { o << t; })
23ostream &
operator<<(ostream &o,
const array<T, N> &
v) {
27 for(
auto b = cbegin(
v) + 1,
e = cend(
v); b !=
e; ++b)
32template<
typename T,
typename A>
33requires(
requires (ostream &o,
T t) { o << t; })
34ostream &
operator<<(ostream &o,
const vector<T, A> &
v) {
38 for(
auto b = cbegin(
v) + 1,
e = cend(
v); b !=
e; ++b)
49template<
template<
typename>
typename V,
typename T, std::size_t
N>
50std::ostream &
operator <<(std::ostream &os,
const vec<V, T, N> &
v);
52std::ostream &
operator <<(std::ostream &os,
const Vertex &
v);
54template<
template<
typename>
typename V,
typename T, std::size_t
N>
57 for(std::size_t
i = 1;
i <
N; ++
i)
63 return os <<
"{" <<
m[0] <<
", " <<
m[1] <<
", " <<
m[2] <<
"}";
69 <<
m[0] <<
", " <<
m[1] <<
", "
70 <<
m[2] <<
", " <<
m[3]
75 return os <<
"{" <<
v.pos <<
", " <<
v.norm <<
", " <<
v.color <<
"}";
80template<
typename T0,
typename T1>
81inline std::string
vdiff(
const T0 &v0,
const T1 &v1);
83template<
typename T0,
typename T1>
84inline std::string
vdiff(
const T0 &v0,
const T1 &v1) {
87 const auto b0 = cbegin(v0), e0 = cend(v0);
88 const auto e1 = cend(v1);
91 while(p0 != e0 && *p0 == *p1) { ++p0; ++p1; }
92 if(p0 == e0 && p1 == e1)
94 const auto i = p0 - b0;
96 const auto fmt = [&
s,
i](
const char *
n,
auto p,
const auto e) {
97 s <<
"\n" <<
n <<
"[" <<
i <<
":]:";
std::string vdiff(const T0 &v0, const T1 &v1)
Definition debug.h:84
for i
Definition font.lua:5
local n
Definition dump_lights.lua:5
local N
Definition gamma.lua:5
local function fmt(name, size, n, max)
mat4_base< float > mat4
Definition mat4.h:62
std::ostream & operator<<(std::ostream &os, const vec< V, T, N > &v)
Definition debug.h:55
v[1]
Definition math.lua:22
Definition graphics.h:136
local e
Definition math.lua:4
std::chrono::seconds s
Definition timing.cpp:6