diff --git a/core/shared_ptr.hh b/core/shared_ptr.hh index 53e6ec1404..032d001775 100644 --- a/core/shared_ptr.hh +++ b/core/shared_ptr.hh @@ -69,6 +69,9 @@ lw_shared_ptr make_lw_shared(T& a); template shared_ptr make_shared(A&&... a); +template +shared_ptr make_shared(T&& a); + template shared_ptr static_pointer_cast(const shared_ptr& p); @@ -375,6 +378,9 @@ public: template friend shared_ptr make_shared(A&&... a); + template + friend shared_ptr make_shared(U&& a); + template friend shared_ptr static_pointer_cast(const shared_ptr& p); @@ -424,6 +430,14 @@ make_shared(A&&... a) { return helper::make(std::forward(a)...); } +template +inline +shared_ptr +make_shared(T&& a) { + using helper = shared_ptr_make_helper, T>::value>; + return helper::make(std::forward(a)); +} + template inline shared_ptr