From 8cc4372d76673c4f5ea89a34407e095f739595dd Mon Sep 17 00:00:00 2001 From: John Date: Wed, 14 Feb 2024 12:11:25 +0000 Subject: [PATCH] provide alternative carinality constructor for CardinalityInterface objects already managed by shared_ptr --- googlemock/include/gmock/gmock-cardinalities.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/googlemock/include/gmock/gmock-cardinalities.h b/googlemock/include/gmock/gmock-cardinalities.h index 533e604f3..5e906e030 100644 --- a/googlemock/include/gmock/gmock-cardinalities.h +++ b/googlemock/include/gmock/gmock-cardinalities.h @@ -97,6 +97,9 @@ class GTEST_API_ Cardinality { // Constructs a Cardinality from its implementation. explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {} + // Constructs a Cardinality from shared_ptr. + explicit Cardinality(std::shared_ptr impl) : impl_(impl) {} + // Conservative estimate on the lower/upper bound of the number of // calls allowed. int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); }