We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enum class Colors: short{ Red = 0, Green, Blue}
when trying to restore it like
Colors c = json["color"].get<Colors>() it's fails with
Colors c = json["color"].get<Colors>()
tools/libs/json.h:862:17: �[Kerror: static assertion failed: could not find from_json() method in T's namespace
The text was updated successfully, but these errors were encountered:
Right now, only enums are supported by default, you can add a from_json method though.
enum
from_json
We could add enum class support, to behave like regular enums by default.
enum class
Sorry, something went wrong.
If we can support this out of the box, we should do it.
Fixed with #545.
Thanks
nlohmann
Successfully merging a pull request may close this issue.
enum class Colors: short{ Red = 0, Green, Blue}
when trying to restore it like
Colors c = json["color"].get<Colors>()
it's fails withThe text was updated successfully, but these errors were encountered: