From d63f5ce1cb86e69da28bd74b21e9452dbd88a38f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 28 Feb 2021 15:42:39 +0000 Subject: Move utility to lib --- utility/ptr.hpp | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 utility/ptr.hpp (limited to 'utility/ptr.hpp') diff --git a/utility/ptr.hpp b/utility/ptr.hpp deleted file mode 100644 index b92b63e..0000000 --- a/utility/ptr.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#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 -- cgit v1.2.3