diff options
Diffstat (limited to 'src/Core/Memory.h')
| -rw-r--r-- | src/Core/Memory.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Core/Memory.h b/src/Core/Memory.h index 0abc6b1..3240c71 100644 --- a/src/Core/Memory.h +++ b/src/Core/Memory.h @@ -2,23 +2,23 @@ #include <memory> -namespace Donut +namespace Donut { template<typename T> using Ref = std::shared_ptr<T>; - template<typename T> + template<typename T> using Scope = std::unique_ptr<T>; - - template<typename T, typename ... Args> - constexpr Scope<T> CreateScope(Args&& ... args) + + template<typename T, typename ... Args> + constexpr auto create_scope(Args&& ... args) -> Scope<T> { return std::make_unique<T>(std::forward<Args>(args)...); } - + template<typename T, typename ... Args> - constexpr Ref<T> CreateRef(Args&& ... args) + constexpr auto create_ref(Args&& ... args) -> Ref<T> { return std::make_shared<T>(std::forward<Args>(args)...); } -};
\ No newline at end of file +}; |
