From 6a015ca1cb4e9d62126f931e5cfcd8e4d2171ded Mon Sep 17 00:00:00 2001 From: Krystian Kuzniarek Date: Wed, 14 Aug 2019 14:21:32 +0200 Subject: reuse IndexSequence from googletest --- .../include/gmock/internal/gmock-internal-utils.h | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index ee00479..273c7c0 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -506,19 +506,8 @@ struct BooleanConstant {}; // reduce code size. GTEST_API_ void IllegalDoDefault(const char* file, int line); -// Helper types for Apply() below. -template struct int_pack { typedef int_pack type; }; - -template struct append; -template -struct append, I> : int_pack {}; - -template -struct make_int_pack : append::type, C - 1> {}; -template <> struct make_int_pack<0> : int_pack<> {}; - template -auto ApplyImpl(F&& f, Tuple&& args, int_pack) -> decltype( +auto ApplyImpl(F&& f, Tuple&& args, IndexSequence) -> decltype( std::forward(f)(std::get(std::forward(args))...)) { return std::forward(f)(std::get(std::forward(args))...); } @@ -527,9 +516,9 @@ auto ApplyImpl(F&& f, Tuple&& args, int_pack) -> decltype( template auto Apply(F&& f, Tuple&& args) -> decltype(ApplyImpl(std::forward(f), std::forward(args), - make_int_pack::value>())) { + MakeIndexSequence::value>())) { return ApplyImpl(std::forward(f), std::forward(args), - make_int_pack::value>()); + MakeIndexSequence::value>()); } // Template struct Function, where F must be a function type, contains -- cgit v0.12