diff --git a/Redcraft.Utility/Source/Public/Templates/Container.h b/Redcraft.Utility/Source/Public/Templates/Container.h index 650e75f..b047074 100644 --- a/Redcraft.Utility/Source/Public/Templates/Container.h +++ b/Redcraft.Utility/Source/Public/Templates/Container.h @@ -23,6 +23,12 @@ constexpr decltype(auto) GetData(T&& Container) return Container.data(); } +template +constexpr decltype(auto) GetData(initializer_list Container) +{ + return Container.begin(); +} + template requires (requires(T&& Container) { Container.Num(); }) constexpr decltype(auto) GetNum(T&& Container) { @@ -40,6 +46,12 @@ constexpr decltype(auto) GetNum(T&& Container) return Container.size(); } +template +constexpr decltype(auto) GetNum(initializer_list Container) +{ + return Container.size(); +} + NAMESPACE_MODULE_END(Utility) NAMESPACE_MODULE_END(Redcraft) NAMESPACE_REDCRAFT_END