Add UnpackStructImpl for structs with 24, 25 and 26 fields.

PiperOrigin-RevId: 770690821
Change-Id: Ic759e29f46a34d0f2c0ef831e0ddc784290a938f
This commit is contained in:
Abseil Team 2025-06-12 09:36:51 -07:00 committed by Copybara-Service
parent 1aeec48a1d
commit 175c1b55cf
1 changed files with 21 additions and 0 deletions

View File

@ -3446,6 +3446,27 @@ auto UnpackStructImpl(const T& in, std::make_index_sequence<23>, char) {
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);
}
template <typename T>
auto UnpackStructImpl(const T& in, std::make_index_sequence<24>, char) {
const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v,
w, x] = in;
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);
}
template <typename T>
auto UnpackStructImpl(const T& in, std::make_index_sequence<25>, char) {
const auto& [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] = in;
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);
}
template <typename T>
auto UnpackStructImpl(const T& in, std::make_index_sequence<26>, char) {
const auto& [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] = in;
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);
}
#endif // defined(__cpp_structured_bindings)
template <size_t I, typename T>