From 0430465d923410f033fa640a4bc00ad7acf910e6 Mon Sep 17 00:00:00 2001 From: Redstone1024 <2824517378@qq.com> Date: Sun, 29 Sep 2024 20:53:19 +0800 Subject: [PATCH] fix(containers): fix TArrayView default initialization is not zero initialization --- Redcraft.Utility/Source/Public/Containers/ArrayView.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Redcraft.Utility/Source/Public/Containers/ArrayView.h b/Redcraft.Utility/Source/Public/Containers/ArrayView.h index 06f0ae9..85a61ee 100644 --- a/Redcraft.Utility/Source/Public/Containers/ArrayView.h +++ b/Redcraft.Utility/Source/Public/Containers/ArrayView.h @@ -45,7 +45,15 @@ public: static constexpr size_t Extent = InExtent; /** Constructs an empty array view. */ - FORCEINLINE constexpr TArrayView() requires (Extent == 0 || Extent == DynamicExtent) = default; + FORCEINLINE constexpr TArrayView() requires (Extent == 0 || Extent == DynamicExtent) + { + Impl.Pointer = nullptr; + + if constexpr (Extent == DynamicExtent) + { + Impl.ArrayNum = 0; + } + } /** Constructs an array view that is a view over the range ['InFirst', 'InFirst' + 'Count'). */ template requires (CConvertibleTo(*)[], ElementType(*)[]>)