-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Description
Lets say i have the following
enum class enum_t
{
foo = 0,
bar = 1,
};
template<>
struct glz::meta<enum_t>
{
using enum enum_t;
static constexpr auto value = enumerate(
"foo", foo,
"bar", bar
);
};
enum_t value = static_cast<enum_t>(100);
std::string buffer{};
glz::write_json(value , buffer);
expect(buffer == "100");By default serialization falls back to int for enums, this can cause a lot of issues with parsers expecing strings.
My question is how can i serialize unknown enum values as for example "unknown"?
Similarly what happens if there is such an inconsistency in a json object, is there a way to skip that value?
Metadata
Metadata
Assignees
Labels
No labels