[*] Update AuResetMember to work on extent arrays

This commit is contained in:
Reece Wilson 2024-06-26 09:22:12 +01:00
parent a3c3810c3b
commit 546ad4f41c

View File

@ -14,11 +14,18 @@ static void AuResetMember(T &ref, Args &&...args)
{
ref.~T();
AuMemset(&ref, 0, sizeof(ref));
new (&ref) T(AuForward<Args &&>(args)...);
new (&ref) T(AuForward<Args>(args)...);
}
else if constexpr (AuIsArray_v<T>)
{
for (AU_ITERATE_N(i, AuArraySize(ref)))
{
AuResetMember(ref[i]);
}
}
else
{
ref = AuDecay_t<T>();
ref = T {};
}
}