From 4bbf80823cbf667488b41ab45bf6d1b15580e977 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Wed, 8 Jan 2025 06:37:41 -0800 Subject: [PATCH] Add UnpackStructImpl for structs with 20 fields. PiperOrigin-RevId: 713272335 Change-Id: I2b289ece4ce3f91834a8c9ba11a4bd18e6e40fca --- googlemock/include/gmock/gmock-matchers.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 2ae2499ad6..8f82b273be 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -3291,6 +3291,11 @@ auto UnpackStructImpl(const T& t, std::make_index_sequence<19>, char) { const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s] = t; return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s); } +template +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); +} #endif // defined(__cpp_structured_bindings) template