diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-01-17 19:36:30 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-01-17 22:16:48 +0000 |
commit | 0bf4ad9e4a9e1c97e92aa23a365405dfef89bd7c (patch) | |
tree | 68a80976a247836bbb1eecc835af437e3489fbb7 /ptr.hpp | |
parent | First cut modernizing and sanitizing (diff) | |
download | ilt-0bf4ad9e4a9e1c97e92aa23a365405dfef89bd7c.tar.bz2 ilt-0bf4ad9e4a9e1c97e92aa23a365405dfef89bd7c.tar.xz ilt-0bf4ad9e4a9e1c97e92aa23a365405dfef89bd7c.zip |
Big reshuffle
Fixes code quality warnings now picked up.
Diffstat (limited to 'ptr.hpp')
-rw-r--r-- | ptr.hpp | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/ptr.hpp b/ptr.hpp deleted file mode 100644 index b92b63e..0000000 --- a/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 |