Replies: 1 comment
-
It sounds like your desire is to be able to list out the excluded fields within a |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I tend to do alot of code like this:
`struct MyStruct {
//Variables I need saved/loaded:
int a;
int b;
int c;
};
std::unordered_map<MyStructID, MyStruct> myMap;`
Is there an way I can skip specific members, while also still benefiting from reflection allowing me to not have to list every member I do want serialized?
My current method is to separate them out into a different struct, that 'MyStruct' then owns, but that is then serialized as an empty member, like this:
template<> struct glz::meta<MyStruct::SubStructToSkip> { static constexpr auto value = glz::object(); };
And this works for my needs fine, but I was wondering if there was a better way to do that.
Beta Was this translation helpful? Give feedback.
All reactions