diff options
author | HampusM <hampus@hampusmat.com> | 2022-02-14 10:11:32 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-02-14 10:11:32 +0100 |
commit | 7892ef9d248c189be68ce7faf63230ec0a318b67 (patch) | |
tree | 7c3d07779d5ce96994f81c0cc22e8b667601ee9d /src/utils/memory.hpp | |
parent | a03dfe959fcafd238119bdf7f27c07b92064496e (diff) |
refactor: reorganize & add debugging
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" |