1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-29 23:01:16 +03:00

more documentation

This commit is contained in:
Niels
2015-06-22 23:21:49 +02:00
parent f1c9aa26c4
commit 48545f5b18
14 changed files with 486 additions and 78 deletions

View File

@ -0,0 +1,23 @@
#include <json.hpp>
using namespace nlohmann;
int main()
{
// create stream with serialized JSON
std::stringstream ss;
ss << R"({
"number": 23,
"string": "Hello, world!",
"array": [1, 2, 3, 4, 5],
"boolean": false,
"null": null
})";
// create JSON value and read the serialization from the stream
json j;
j << ss;
// serialize JSON
std::cout << std::setw(2) << j << '\n';
}