#pragma once #include "CoreTypes.h" NAMESPACE_REDCRAFT_BEGIN NAMESPACE_MODULE_BEGIN(Redcraft) NAMESPACE_MODULE_BEGIN(Utility) template requires requires(T&& Container) { Container.GetData(); } constexpr decltype(auto) GetData(T&& Container) { return Container.GetData(); } template constexpr T* GetData( T(& Container)[N]) { return Container; } template constexpr T* GetData( T(&& Container)[N]) { return Container; } template constexpr const T* GetData(const T(& Container)[N]) { return Container; } template constexpr const T* GetData(const T(&& Container)[N]) { return Container; } template requires requires(T&& Container) { Container.data(); } constexpr decltype(auto) GetData(T&& Container) { return Container.data(); } template requires requires(T&& Container) { Container.Num(); } constexpr decltype(auto) GetNum(T&& Container) { return Container.Num(); } template constexpr size_t GetNum( T(& Container)[N]) { return N; } template constexpr size_t GetNum( T(&& Container)[N]) { return N; } template constexpr size_t GetNum(const T(& Container)[N]) { return N; } template constexpr size_t GetNum(const T(&& Container)[N]) { return N; } template requires requires(T&& Container) { Container.size(); } constexpr decltype(auto) GetNum(T&& Container) { return Container.size(); } NAMESPACE_MODULE_END(Utility) NAMESPACE_MODULE_END(Redcraft) NAMESPACE_REDCRAFT_END