summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-10-14 16:55:07 -0400
committerDerek Mauro <dmauro@google.com>2020-10-14 18:27:07 -0400
commita4621888650aaae118de93f9faf8ef5a18cab303 (patch)
treecdef9c7c10bd81a75ad8e0b2dd9cf878ba85f20a /googletest/include/gtest
parentf3dbe3ec44e0163c4659ec7cd541ca7af66632bc (diff)
downloadgoogletest-a4621888650aaae118de93f9faf8ef5a18cab303.tar.gz
googletest-a4621888650aaae118de93f9faf8ef5a18cab303.zip
Googletest export
Add ::testing::FieldsAre matcher for objects that support get<> and structured bindings. PiperOrigin-RevId: 337165285
Diffstat (limited to 'googletest/include/gtest')
-rw-r--r--googletest/include/gtest/internal/gtest-internal.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h
index 959f6fcf..0500dea6 100644
--- a/googletest/include/gtest/internal/gtest-internal.h
+++ b/googletest/include/gtest/internal/gtest-internal.h
@@ -1178,12 +1178,18 @@ struct DoubleSequence<false, IndexSequence<I...>, sizeofT> {
// Backport of std::make_index_sequence.
// It uses O(ln(N)) instantiation depth.
template <size_t N>
-struct MakeIndexSequence
- : DoubleSequence<N % 2 == 1, typename MakeIndexSequence<N / 2>::type,
+struct MakeIndexSequenceImpl
+ : DoubleSequence<N % 2 == 1, typename MakeIndexSequenceImpl<N / 2>::type,
N / 2>::type {};
template <>
-struct MakeIndexSequence<0> : IndexSequence<> {};
+struct MakeIndexSequenceImpl<0> : IndexSequence<> {};
+
+template <size_t N>
+using MakeIndexSequence = typename MakeIndexSequenceImpl<N>::type;
+
+template <typename... T>
+using IndexSequenceFor = typename MakeIndexSequence<sizeof...(T)>::type;
template <size_t>
struct Ignore {
OpenPOWER on IntegriCloud