JSON for Modern C++ -- Niels Lohmann

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.

Comments (1)

0 0

jeremymy said on Jun 29, 2015 09:50 AM:

This is a great JSON / C++ implementation. Thank you. I haven't seen one that is more user friendly.