mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Ensures overloaded assignments work.
This commit is contained in:
parent
68645742f7
commit
c953ab09db
@ -215,7 +215,8 @@ template <typename Type> 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<const uint8_t *>(target.get(name)) + offset * sizeof(Type), sizeof(Type));
|
||||
const auto address = reinterpret_cast<const uint8_t *>(target.get(name)) + offset * sizeof(Type);
|
||||
value = *reinterpret_cast<const Type *>(address);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user