From 546ad4f41ccfaeeaeb4298f6ba3eb0767c7e6470 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Wed, 26 Jun 2024 09:22:12 +0100 Subject: [PATCH] [*] Update AuResetMember to work on extent arrays --- Include/auROXTL/Objects/ResetMember.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Include/auROXTL/Objects/ResetMember.hpp b/Include/auROXTL/Objects/ResetMember.hpp index 96d96c8..eaa611e 100644 --- a/Include/auROXTL/Objects/ResetMember.hpp +++ b/Include/auROXTL/Objects/ResetMember.hpp @@ -14,11 +14,18 @@ static void AuResetMember(T &ref, Args &&...args) { ref.~T(); AuMemset(&ref, 0, sizeof(ref)); - new (&ref) T(AuForward(args)...); + new (&ref) T(AuForward(args)...); + } + else if constexpr (AuIsArray_v) + { + for (AU_ITERATE_N(i, AuArraySize(ref))) + { + AuResetMember(ref[i]); + } } else { - ref = AuDecay_t(); + ref = T {}; } }