Skip to content

Commit

Permalink
Add UnpackStructImpl for structs with 21 fields.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 731737844
Change-Id: I3efeb26b0bf179958c8a3eda0b55dfc3d7778fb9
  • Loading branch information
Abseil Team authored and copybara-github committed Feb 27, 2025
1 parent e5669fd commit 144d335
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions googlemock/include/gmock/gmock-matchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
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 <size_t I, typename T>
Expand Down

0 comments on commit 144d335

Please sign in to comment.