1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-06 06:42:33 +03:00

simplified flatten/unflatten examples

This commit is contained in:
Niels
2016-04-30 10:39:03 +02:00
parent a21f8b0c77
commit ea84a85b13
7 changed files with 5 additions and 25 deletions

View File

@ -20,18 +20,11 @@ int main()
{
"object", {
{"currency", "USD"},
{"value", 42.99},
{"", "empty string"},
{"/", "slash"},
{"~", "tilde"},
{"~1", "tilde1"}
{"value", 42.99}
}
}
};
// call flatten()
std::cout << std::setw(4) << j.flatten() << '\n';
// flatten for a primitive value
std::cout << j["pi"].flatten() << '\n';
}