From 175c1b55cfb3dbed519b94a370c083aac605009f Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 12 Jun 2025 09:36:51 -0700 Subject: [PATCH] Add UnpackStructImpl for structs with 24, 25 and 26 fields. PiperOrigin-RevId: 770690821 Change-Id: Ic759e29f46a34d0f2c0ef831e0ddc784290a938f --- googlemock/include/gmock/gmock-matchers.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 5a04d7fac..50e97b7c1 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -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 +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 +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 +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