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; }