From bb2725346db5e19da905ddfdeb02bfba08b4fd74 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 17 Sep 2020 11:02:40 -0400 Subject: [PATCH] Googletest export Reduce the demangled name bloat of the Action constructor. PiperOrigin-RevId: 332234887 --- googlemock/include/gmock/gmock-actions.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index cdff6949..02b17c7d 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -449,6 +449,9 @@ class Action { } }; + template + using IsCompatibleFunctor = std::is_constructible, G>; + public: typedef typename internal::Function::Result Result; typedef typename internal::Function::ArgumentTuple ArgumentTuple; @@ -460,15 +463,13 @@ class Action { // Construct an Action from a specified callable. // This cannot take std::function directly, because then Action would not be // directly constructible from lambda (it would require two conversions). - template , G>, - typename IsNoArgsFunctor = - ::std::is_constructible<::std::function, G>, - typename = typename ::std::enable_if::value>::type> + template < + typename G, + typename = typename std::enable_if, std::is_constructible, + G>>::value>::type> Action(G&& fun) { // NOLINT - Init(::std::forward(fun), IsCompatibleFunctor()); + Init(::std::forward(fun), IsCompatibleFunctor()); } // Constructs an Action from its implementation.