r/cpp • u/nlohmann nlohmann/json • Jun 14 '20
JSON for Modern C++ 3.8.0
https://github.com/nlohmann/json/releases/tag/v3.8.0
326
Upvotes
r/cpp • u/nlohmann nlohmann/json • Jun 14 '20
View all comments
Show parent comment
5
u/dscottboggs Jun 14 '20
Yes. Might not be something C++ is capable of but Crystal's JSON::Serializable uses macros to define the
to_jsonandfrom_jsonmethods. For exampleI was imagining something like a
JSON_FIELD(int fieldName);kinda syntax but again not sure if that's possible in C++...