Skip to content

Commit

Permalink
Add UnpackStructImpl for structs with 20 fields.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 713272335
Change-Id: I2b289ece4ce3f91834a8c9ba11a4bd18e6e40fca
  • Loading branch information
Abseil Team authored and copybara-github committed Jan 8, 2025
1 parent 7d76a23 commit 4bbf808
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions googlemock/include/gmock/gmock-matchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 4bbf808

Please sign in to comment.