From 592e339b70b9e3484942ece4736375893c0768eb Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 24 Apr 2025 21:12:17 -0400 Subject: [PATCH] Resolve syntax error, fix line lengths. --- Reflection/Struct.hpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Reflection/Struct.hpp b/Reflection/Struct.hpp index a367d69a7..870aeea9f 100644 --- a/Reflection/Struct.hpp +++ b/Reflection/Struct.hpp @@ -151,7 +151,7 @@ template Type get(const Struct &target, const std::string &name, template class StructImpl: public Struct { public: - StructImpl() { + StructImpl() { static std::once_flag once; std::call_once(once, [this] { static_cast(this)->declare_fields(); @@ -177,7 +177,11 @@ public: const auto iterator = contents_.find(name); if(iterator == contents_.end()) return; assert(offset < iterator->second.count); - memcpy(reinterpret_cast(this) + iterator->second.offset + offset * iterator->second.size, value, iterator->second.size); + memcpy( + reinterpret_cast(this) + iterator->second.offset + offset * iterator->second.size, + value, + iterator->second.size + ); } /*! @@ -338,7 +342,12 @@ private: contents_.emplace( std::make_pair( name, - Field(typeid(Type), reinterpret_cast(t) - reinterpret_cast(this), sizeof(Type), count) + Field( + typeid(Type), + reinterpret_cast(t) - reinterpret_cast(this), + sizeof(Type), + count + ) )); }