From: Abseil Team Date: Thu, 9 Jan 2020 16:59:39 +0000 (-0500) Subject: Googletest export X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c901f67ddf8aab44443f1be3efe864cb3daa95af;p=googletest.git Googletest export Move part of functionality of Action* class to the base one. Reduce copypaste. Make constructor and conversion operator of Action* class independent of pump. PiperOrigin-RevId: 288907005 --- diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index 11223cf..a7b84d1 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -1222,6 +1222,43 @@ class ActionHelper { } }; +// A helper base class needed for implementing the ACTION* macros. +// Implements constructor and conversion operator for Action. +// +// Template specialization for parameterless Action. +template +class ActionImpl { + public: + ActionImpl() = default; + + template + operator ::testing::Action() const { // NOLINT(runtime/explicit) + return ::testing::Action(new typename Derived::template gmock_Impl()); + } +}; + +// Template specialization for parameterized Action. +template