mirror of
https://github.com/nlohmann/json.git
synced 2024-12-19 01:27:51 +08:00
[JSON] drop use of std::tie and std::tupe for operator== overload. valgrind and clang < 4 complain
This commit is contained in:
parent
678d310b85
commit
7660ea12f6
@ -29,7 +29,6 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
|
||||||
#include "doctest_compatibility.h"
|
#include "doctest_compatibility.h"
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
@ -109,8 +108,32 @@ class person_with_private_alphabet
|
|||||||
public:
|
public:
|
||||||
bool operator==(const person_with_private_alphabet& other)
|
bool operator==(const person_with_private_alphabet& other)
|
||||||
{
|
{
|
||||||
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) ==
|
return a == other.a &&
|
||||||
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);
|
b == other.b &&
|
||||||
|
c == other.c &&
|
||||||
|
d == other.d &&
|
||||||
|
e == other.e &&
|
||||||
|
f == other.f &&
|
||||||
|
g == other.g &&
|
||||||
|
h == other.h &&
|
||||||
|
i == other.i &&
|
||||||
|
j == other.j &&
|
||||||
|
k == other.k &&
|
||||||
|
l == other.l &&
|
||||||
|
m == other.m &&
|
||||||
|
n == other.n &&
|
||||||
|
o == other.o &&
|
||||||
|
p == other.p &&
|
||||||
|
q == other.q &&
|
||||||
|
r == other.r &&
|
||||||
|
s == other.s &&
|
||||||
|
t == other.t &&
|
||||||
|
u == other.u &&
|
||||||
|
v == other.v &&
|
||||||
|
w == other.w &&
|
||||||
|
x == other.x &&
|
||||||
|
y == other.y &&
|
||||||
|
z == other.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -148,8 +171,32 @@ class person_with_public_alphabet
|
|||||||
public:
|
public:
|
||||||
bool operator==(const person_with_public_alphabet& other)
|
bool operator==(const person_with_public_alphabet& other)
|
||||||
{
|
{
|
||||||
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) ==
|
return a == other.a &&
|
||||||
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);
|
b == other.b &&
|
||||||
|
c == other.c &&
|
||||||
|
d == other.d &&
|
||||||
|
e == other.e &&
|
||||||
|
f == other.f &&
|
||||||
|
g == other.g &&
|
||||||
|
h == other.h &&
|
||||||
|
i == other.i &&
|
||||||
|
j == other.j &&
|
||||||
|
k == other.k &&
|
||||||
|
l == other.l &&
|
||||||
|
m == other.m &&
|
||||||
|
n == other.n &&
|
||||||
|
o == other.o &&
|
||||||
|
p == other.p &&
|
||||||
|
q == other.q &&
|
||||||
|
r == other.r &&
|
||||||
|
s == other.s &&
|
||||||
|
t == other.t &&
|
||||||
|
u == other.u &&
|
||||||
|
v == other.v &&
|
||||||
|
w == other.w &&
|
||||||
|
x == other.x &&
|
||||||
|
y == other.y &&
|
||||||
|
z == other.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
int a;
|
int a;
|
||||||
|
Loading…
Reference in New Issue
Block a user