summaryrefslogtreecommitdiff
path: root/utility/ptr.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'utility/ptr.hpp')
-rw-r--r--utility/ptr.hpp25
1 files changed, 0 insertions, 25 deletions
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 <memory>
-
-template<typename Obj> class wrapped_ptr : public std::unique_ptr<Obj, void (*)(Obj *)> {
-public:
- using std::unique_ptr<Obj, void (*)(Obj *)>::unique_ptr;
- wrapped_ptr() : std::unique_ptr<Obj, void (*)(Obj *)> {{}, {}} { }
-
- inline
- operator Obj *() const
- {
- return this->get();
- }
-
- template<typename... Args, typename... Params>
- static auto
- create(Obj * (*factory)(Args...), void (*deleter)(Obj *), Params &&... params)
- {
- return wrapped_ptr<Obj> {factory(std::forward<Params>(params)...), deleter};
- }
-};
-
-#endif