diff options
author | Abseil Team <absl-team@google.com> | 2025-01-08 14:37:41 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2025-01-08 14:38:13 (GMT) |
commit | 4bbf80823cbf667488b41ab45bf6d1b15580e977 (patch) | |
tree | 6929ac5febb7354cf8d92a1e44b11fda4227dc2c | |
parent | 7d76a231b0e29caf86e68d1df858308cd53b2a66 (diff) | |
download | googletest-4bbf80823cbf667488b41ab45bf6d1b15580e977.zip googletest-4bbf80823cbf667488b41ab45bf6d1b15580e977.tar.gz googletest-4bbf80823cbf667488b41ab45bf6d1b15580e977.tar.bz2 |
Add UnpackStructImpl for structs with 20 fields.
PiperOrigin-RevId: 713272335
Change-Id: I2b289ece4ce3f91834a8c9ba11a4bd18e6e40fca
-rw-r--r-- | googlemock/include/gmock/gmock-matchers.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 2ae2499..8f82b27 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 <typename T> +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 <size_t I, typename T> |