Closed riidefi closed 10 months ago
You can use rfl::default_value
as shown here:
https://github.com/getml/reflect-cpp/blob/main/docs/structs.md
And this is actually very much on purpose. It prevents you from accidentally forgetting fields, which can lead to very tricky runtime errors. The reasoning is explained here:
https://github.com/getml/reflect-cpp/blob/main/docs/custom_classes.md
It is technically not necessary at all. As a compromise, what we could do is to offer some kind of alternative syntax, maybe like this:
rfl::Field<"children", std::vector<s32>, rfl::default_constructible> mChildren
If you can come up with a more concise syntax, I'm open to suggestions.
Is this boilerplate actually necessary?