Classes without default constructor #385
-
Very interesting library, thank you for publishing it. I started playing around with it and I was wondering if there is any support for classes without default constructor. Considering the following minimal example
The deserialization fails to compile as glaze is obviously looking for the default constructor of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
@Haatschii Foo test{3, 7};
auto parse_error = glz::read_json(test, buffer); This will parse the buffer into |
Beta Was this translation helpful? Give feedback.
@Haatschii
So, I've been thinking more about this problem. And, I'm torn about adding the feature.
Let's say we have:
I can make a constructor based on
x
andy
from this object definition. But, there's a good chance I want to serializez
. So, I need another definition to separate the constructor from the serialization and deserialization.template <…