Skip to content

Commit 175c1b5

Browse files
Abseil Teamcopybara-github
authored andcommitted
Add UnpackStructImpl for structs with 24, 25 and 26 fields.
PiperOrigin-RevId: 770690821 Change-Id: Ic759e29f46a34d0f2c0ef831e0ddc784290a938f
1 parent 1aeec48 commit 175c1b5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

googlemock/include/gmock/gmock-matchers.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3446,6 +3446,27 @@ auto UnpackStructImpl(const T& in, std::make_index_sequence<23>, char) {
34463446
return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u,
34473447
v, w);
34483448
}
3449+
template <typename T>
3450+
auto UnpackStructImpl(const T& in, std::make_index_sequence<24>, char) {
3451+
const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v,
3452+
w, x] = in;
3453+
return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u,
3454+
v, w, x);
3455+
}
3456+
template <typename T>
3457+
auto UnpackStructImpl(const T& in, std::make_index_sequence<25>, char) {
3458+
const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v,
3459+
w, x, y] = in;
3460+
return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u,
3461+
v, w, x, y);
3462+
}
3463+
template <typename T>
3464+
auto UnpackStructImpl(const T& in, std::make_index_sequence<26>, char) {
3465+
const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v,
3466+
w, x, y, z] = in;
3467+
return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u,
3468+
v, w, x, y, z);
3469+
}
34493470
#endif // defined(__cpp_structured_bindings)
34503471

34513472
template <size_t I, typename T>

0 commit comments

Comments
 (0)