From c953ab09db3e27749168a6fed47219b0efcecb2e Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 20 Jun 2020 00:17:16 -0400 Subject: [PATCH] Ensures overloaded assignments work. --- Reflection/Struct.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Reflection/Struct.cpp b/Reflection/Struct.cpp index 72c2e2162..72cdf895b 100644 --- a/Reflection/Struct.cpp +++ b/Reflection/Struct.cpp @@ -215,7 +215,8 @@ template bool Reflection::get(const Struct &target, const std::s // If type is a direct match, copy. if(*target_type == typeid(Type)) { - memcpy(&value, reinterpret_cast(target.get(name)) + offset * sizeof(Type), sizeof(Type)); + const auto address = reinterpret_cast(target.get(name)) + offset * sizeof(Type); + value = *reinterpret_cast(address); return true; }