#ifndef PTR_H #define PTR_H #include template class wrapped_ptr : public std::unique_ptr { public: using std::unique_ptr::unique_ptr; wrapped_ptr() : std::unique_ptr {{}, {}} { } inline operator Obj *() const { return this->get(); } template static auto create(Obj * (*factory)(Args...), void (*deleter)(Obj *), Params &&... params) { return wrapped_ptr {factory(std::forward(params)...), deleter}; } }; #endif