From 144d335538fd0a06018c553d7d2e4f369e25735d Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 27 Feb 2025 08:35:23 -0800 Subject: [PATCH] Add UnpackStructImpl for structs with 21 fields. PiperOrigin-RevId: 731737844 Change-Id: I3efeb26b0bf179958c8a3eda0b55dfc3d7778fb9 --- googlemock/include/gmock/gmock-matchers.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 8903c7ac..47311d46 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -3305,6 +3305,13 @@ auto UnpackStructImpl(const T& u, std::make_index_sequence<20>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t] = u; return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t); } +template +auto UnpackStructImpl(const T& in, std::make_index_sequence<21>, char) { + const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u] = + 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); +} #endif // defined(__cpp_structured_bindings) template