Skip to content

Commit 7660ea1

Browse files
author
pf
committed
[JSON] drop use of std::tie and std::tupe for operator== overload. valgrind and clang < 4 complain
1 parent 678d310 commit 7660ea1

File tree

1 file changed

+52
-5
lines changed

1 file changed

+52
-5
lines changed

test/src/unit-udt_macro.cpp

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ SOFTWARE.
2929

3030
#include <string>
3131
#include <vector>
32-
#include <cassert>
3332
#include "doctest_compatibility.h"
3433

3534
#include <nlohmann/json.hpp>
@@ -109,8 +108,32 @@ class person_with_private_alphabet
109108
public:
110109
bool operator==(const person_with_private_alphabet& other)
111110
{
112-
return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) ==
113-
std::tie(other.a, other.b, other.c, other.d, other.e, other.f, other.g, other.h, other.i, other.j, other.k, other.l, other.m, other.n, other.o, other.p, other.q, other.r, other.s, other.t, other.u, other.v, other.w, other.x, other.y, other.z);
111+
return a == other.a &&
112+
b == other.b &&
113+
c == other.c &&
114+
d == other.d &&
115+
e == other.e &&
116+
f == other.f &&
117+
g == other.g &&
118+
h == other.h &&
119+
i == other.i &&
120+
j == other.j &&
121+
k == other.k &&
122+
l == other.l &&
123+
m == other.m &&
124+
n == other.n &&
125+
o == other.o &&
126+
p == other.p &&
127+
q == other.q &&
128+
r == other.r &&
129+
s == other.s &&
130+
t == other.t &&
131+
u == other.u &&
132+
v == other.v &&
133+
w == other.w &&
134+
x == other.x &&
135+
y == other.y &&
136+
z == other.z;
114137
}
115138

116139
private:
@@ -148,8 +171,32 @@ class person_with_public_alphabet
148171
public:
149172
bool operator==(const person_with_public_alphabet& other)
150173
{
151-
return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) ==
152-
std::tie(other.a, other.b, other.c, other.d, other.e, other.f, other.g, other.h, other.i, other.j, other.k, other.l, other.m, other.n, other.o, other.p, other.q, other.r, other.s, other.t, other.u, other.v, other.w, other.x, other.y, other.z);
174+
return a == other.a &&
175+
b == other.b &&
176+
c == other.c &&
177+
d == other.d &&
178+
e == other.e &&
179+
f == other.f &&
180+
g == other.g &&
181+
h == other.h &&
182+
i == other.i &&
183+
j == other.j &&
184+
k == other.k &&
185+
l == other.l &&
186+
m == other.m &&
187+
n == other.n &&
188+
o == other.o &&
189+
p == other.p &&
190+
q == other.q &&
191+
r == other.r &&
192+
s == other.s &&
193+
t == other.t &&
194+
u == other.u &&
195+
v == other.v &&
196+
w == other.w &&
197+
x == other.x &&
198+
y == other.y &&
199+
z == other.z;
153200
}
154201

155202
int a;

0 commit comments

Comments
 (0)