diff options
Diffstat (limited to 'src/utils/memory.hpp')
-rw-r--r-- | src/utils/memory.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/utils/memory.hpp b/src/utils/memory.hpp new file mode 100644 index 0000000..81e3757 --- /dev/null +++ b/src/utils/memory.hpp @@ -0,0 +1,23 @@ +#pragma once + +template <typename memType> +memType *malloc_s(unsigned int size); + +template <class Target> +class unique_ptr +{ +public: + unique_ptr(Target *target); + ~unique_ptr(); + + Target operator *() const; + Target *operator ->() const; + +private: + Target *_target; +}; + +template<class Target, typename...Args> +unique_ptr<Target> make_unique(Args&... args); + +#include "memory.tpp" |