From 88c0301166249cdf37353e5db90f190db866b6e0 Mon Sep 17 00:00:00 2001 From: scorpioblood <77296181+scorpioblood@users.noreply.github.com> Date: Thu, 23 May 2024 21:35:43 +0200 Subject: [PATCH] Add shared_ptr / unique_ptr alias --- Engine/src/Runtime/Core/Core.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Engine/src/Runtime/Core/Core.h b/Engine/src/Runtime/Core/Core.h index d15bfba..4838b68 100644 --- a/Engine/src/Runtime/Core/Core.h +++ b/Engine/src/Runtime/Core/Core.h @@ -1,4 +1,5 @@ #pragma once +// TODO: Refactor documentation #ifdef P_WIN_BUILD @@ -43,15 +44,27 @@ namespace Phanes { + // Alias for shared_ptr template using Ref = std::shared_ptr; + // Alias for make_shared template constexpr Ref MakeRef(Args&& ...args) { return std::make_shared(std::forward(args)...); } + // Alias for unique ptr + template + using Scope = std::unique_ptr; + + // Alias for make_unique + template + constexpr Scope MakeScope(Args&& ...args) + { + return std::make_unique(std::forward(args)...); + } }