diff --git a/safe_ptr.h b/safe_ptr.h index c0c30f9..ee123b6 100644 --- a/safe_ptr.h +++ b/safe_ptr.h @@ -85,6 +85,7 @@ namespace sf { public: template safe_ptr(Args... args) : ptr(std::make_shared(args...)), mtx_ptr(std::make_shared()) {} + explicit safe_ptr(std::unique_ptr&& ptr) : ptr(std::move(ptr)), mtx_ptr(std::make_shared()) {} auto_lock_t operator -> () { return auto_lock_t(get_obj_ptr(), *get_mtx_ptr()); } auto_lock_obj_t operator * () { return auto_lock_obj_t(get_obj_ptr(), *get_mtx_ptr()); }