diff options
author | Xiaoyi Zhang <zhangxy@google.com> | 2019-08-23 20:39:03 (GMT) |
---|---|---|
committer | Xiaoyi Zhang <zhangxy@google.com> | 2019-08-23 20:39:04 (GMT) |
commit | 46525e1e5dfcb0a3c195bc2f94859b196e7cba76 (patch) | |
tree | 7f8a2117bbff3c58639e9fda273a21a4655d872f /googlemock/include | |
parent | c6d884096ae5976fb7f082a8d6e0f3259d930c41 (diff) | |
parent | 6a015ca1cb4e9d62126f931e5cfcd8e4d2171ded (diff) | |
download | googletest-46525e1e5dfcb0a3c195bc2f94859b196e7cba76.zip googletest-46525e1e5dfcb0a3c195bc2f94859b196e7cba76.tar.gz googletest-46525e1e5dfcb0a3c195bc2f94859b196e7cba76.tar.bz2 |
Merge pull request #2394 from kuzkry:custom-type-traits-duplication-of-custom-index_sequence
PiperOrigin-RevId: 264863984
Diffstat (limited to 'googlemock/include')
-rw-r--r-- | googlemock/include/gmock/internal/gmock-internal-utils.h | 17 |
1 files 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 c49e28e..5386f48 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -479,19 +479,8 @@ struct BooleanConstant {}; // reduce code size. GTEST_API_ void IllegalDoDefault(const char* file, int line); -// Helper types for Apply() below. -template <size_t... Is> struct int_pack { typedef int_pack type; }; - -template <class Pack, size_t I> struct append; -template <size_t... Is, size_t I> -struct append<int_pack<Is...>, I> : int_pack<Is..., I> {}; - -template <size_t C> -struct make_int_pack : append<typename make_int_pack<C - 1>::type, C - 1> {}; -template <> struct make_int_pack<0> : int_pack<> {}; - template <typename F, typename Tuple, size_t... Idx> -auto ApplyImpl(F&& f, Tuple&& args, int_pack<Idx...>) -> decltype( +auto ApplyImpl(F&& f, Tuple&& args, IndexSequence<Idx...>) -> decltype( std::forward<F>(f)(std::get<Idx>(std::forward<Tuple>(args))...)) { return std::forward<F>(f)(std::get<Idx>(std::forward<Tuple>(args))...); } @@ -500,9 +489,9 @@ auto ApplyImpl(F&& f, Tuple&& args, int_pack<Idx...>) -> decltype( template <typename F, typename Tuple> auto Apply(F&& f, Tuple&& args) -> decltype(ApplyImpl(std::forward<F>(f), std::forward<Tuple>(args), - make_int_pack<std::tuple_size<Tuple>::value>())) { + MakeIndexSequence<std::tuple_size<Tuple>::value>())) { return ApplyImpl(std::forward<F>(f), std::forward<Tuple>(args), - make_int_pack<std::tuple_size<Tuple>::value>()); + MakeIndexSequence<std::tuple_size<Tuple>::value>()); } // Template struct Function<F>, where F must be a function type, contains |