diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h index a8ab0942..c5821b64 100644 --- a/googletest/include/gtest/internal/gtest-internal.h +++ b/googletest/include/gtest/internal/gtest-internal.h @@ -1124,9 +1124,25 @@ struct MakeIndexSequence template <> struct MakeIndexSequence<0> : IndexSequence<> {}; -template -struct Ignore { - Ignore(...); // NOLINT +template +struct ListElem { + using type = T; +}; + +template +struct ElemFromListImpl; + +template +struct ElemFromListImpl, Ts...> : ListElem... {}; + +template +struct ElemFromList { + template + static Type get_type(const ListElem&); + + using type = decltype( + get_type(ElemFromListImpl::type, + Ts...>())); }; template @@ -1154,37 +1170,10 @@ struct EnableIfAll : EnableIfAllImpl::type, Cs...> {}; -template -struct EmptyListElem {}; - -template -struct ListElem { - using type = T; -}; - -template -struct ElemFromListImpl; -template -struct ElemFromListImpl> { - // We make Ignore a template to solve a problem with MSVC. - // A non-template Ignore would work fine with `decltype(Ignore(I))...`, but - // MSVC doesn't understand how to deal with that pack expansion. - // Use `0 * I` to have a single instantiation of Ignore. - template - static R Apply(Ignore<0 * I>..., R (*)(), ...); -}; - -template -struct ElemFromList { - using type = - decltype(ElemFromListImpl::type>::Apply( - static_cast(nullptr)...)); -}; - template struct FlatTupleElem { T value; - FlatTupleElem() noexcept(std::is_nothrow_constructible::value) : value() {} + FlatTupleElem() = default; template ::value>::type> @@ -1192,12 +1181,11 @@ struct FlatTupleElem { }; template -class FlatTupleBase; +struct FlatTupleBase; template -class FlatTupleBase, Ts...> : FlatTupleElem... { - public: - FlatTupleBase() {} +struct FlatTupleBase, Ts...> : FlatTupleElem... { + FlatTupleBase() = default; template , Ts...> : FlatTupleElem... { template struct FlatTuple : FlatTupleBase::type, Ts...> { - FlatTuple() {} - + FlatTuple() = default; template < typename... Args, typename = typename EnableIfAll<