diff --git a/Hazel/src/Hazel/Core/Base.h b/Hazel/src/Hazel/Core/Base.h index 426baa0d2..6614d7f9d 100644 --- a/Hazel/src/Hazel/Core/Base.h +++ b/Hazel/src/Hazel/Core/Base.h @@ -29,14 +29,29 @@ namespace Hazel { template using Scope = std::unique_ptr; + template + constexpr Scope GetScope(T& ptr) + { + return std::unique_ptr(&ptr); + } template constexpr Scope CreateScope(Args&& ... args) { return std::make_unique(std::forward(args)...); } - + template using Ref = std::shared_ptr; + template + constexpr Ref GetRef(T& ptr) + { + return std::shared_ptr(&ptr); + } + template + constexpr Ref CastRef(Ref& ptr) + { + return std::static_pointer_cast(ptr); + } template constexpr Ref CreateRef(Args&& ... args) {