billyquith / ponder

C++ reflection library with Lua binding, and JSON and XML serialisation.
http://billyquith.github.io/ponder/
Other
633 stars 92 forks source link

How to properly set nested UserObjects? #119

Open EvilPotat0 opened 4 years ago

EvilPotat0 commented 4 years ago

I'm upgrading my project to the latest version of ponder and in the release notes I saw "Changed UserObject reference semantics.". With this change I'm not sure how I go about setting nested user types. For example if you look at seralise.hpp ArchiveReader::read

if (arrayProperty.elementType() == ValueKind::User) { read(item, arrayProperty.get(object, index).to<UserObject>()); } With the new semantics, doesn't that Value.to just make a copy and not actually update the object as you'd expect?

If I'm way off and there's documentation you could point me at it would be greatly appreciated.

Thanks

billyquith commented 4 years ago

Hi Mr Potato. Sorry about that. I'll have to look into this. I'll try over the weekend but I have to tile my bathroom.