diff --git a/ctl/shared_ptr.h b/ctl/shared_ptr.h index 7b1080097..4553c2f99 100644 --- a/ctl/shared_ptr.h +++ b/ctl/shared_ptr.h @@ -90,15 +90,14 @@ template class shared_pointer : public shared_ref { public: - static shared_pointer* make(T* const p, auto&& d) + static shared_pointer* make(T* const p, D d) { - auto p2 = unique_ptr(p); - return new shared_pointer(p2.release(), forward(d)); + auto p2 = unique_ptr(p, move(d)); + return new shared_pointer(p2.release(), move(p2.get_deleter())); } private: - shared_pointer(T* const p, auto&& d) noexcept - : p(p), d(forward(d)) + shared_pointer(T* const p, D d) noexcept : p(p), d(move(d)) { }