diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index fab99933..8d33fb4a 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -770,9 +770,13 @@ class Action { Init(::std::forward(fun), IsCompatibleFunctor()); } - // Constructs an Action from its implementation. + // Constructs an Action from shared pointer. + explicit Action(::std::shared_ptr> impl) + : fun_(ActionAdapter{impl}) {} + + // Constructs an Action from its implementation (now delegating). explicit Action(ActionInterface* impl) - : fun_(ActionAdapter{::std::shared_ptr>(impl)}) {} + : Action{::std::shared_ptr>(impl)} {} // This constructor allows us to turn an Action object into an // Action, as long as F's arguments can be implicitly converted