From e26132504aefa8a251cfb08a3cd4e79807dc12fd Mon Sep 17 00:00:00 2001 From: rawpowerlaxity Date: Sun, 21 Jan 2024 22:29:45 +0100 Subject: [PATCH] [minor] Fixed issue with TOptional and lifetime management of the held value due to not scoping the instance of T in a union. --- SIDFactoryII/source/foundation/base/toptional.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SIDFactoryII/source/foundation/base/toptional.h b/SIDFactoryII/source/foundation/base/toptional.h index 2130cf5..004e1f1 100644 --- a/SIDFactoryII/source/foundation/base/toptional.h +++ b/SIDFactoryII/source/foundation/base/toptional.h @@ -88,6 +88,10 @@ namespace Foundation private: bool m_IsValid; - T m_Value; + + union + { + T m_Value; + }; }; } \ No newline at end of file