NLOHMANN_JSON_SERIALIZE_ENUM potentially requires duplicate definitions #1450
Labels
state: stale
the issue has not been updated in a while and will be closed automatically soon unless it is updated
As many others have said this is a pretty fantastic library.
I'm trying to serialize some enums and this works (with the right to_json and from_json functions defined but not shown here):
however if I want to use those string definitions independent of json then I have to define another mapping, something like
and unfortunately this doesn't work:
because the macro is expecting something that can be converted to an array of std::pairs.
Is there way to not have to duplicate the definitions?
The text was updated successfully, but these errors were encountered: