mirror of
https://github.com/nlohmann/json.git
synced 2026-11-15 11:58:21 +00:00
simplified flatten/unflatten examples
This commit is contained in:
1 parent
a21f8b0c77
commit
ea84a85b13
7 files changed
+5
-25
No files matched your search
@@ -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';
|
||||
}
|
||||
Reference in new issue
Block a user