A new GitHub project With a very readable README:
JSON for Modern C++
by Niels Lohmann
From the README:
... You can create an object (deserialization) by appending
_json
to a string literal:// create object from string literal json j = "{ \"pi\": 3.141, \"happy\": true }"_json;[Note: Or perhaps
auto j = R"({ "pi": 3.141, "happy": true })"_json;
--Ed.]You can also get a string representation (serialize):
// explicit conversion to string std::string s = j.to_string();
Add a Comment
Comments are closed.