deploy: 4155e2938f
This commit is contained in:
1 parent
be4d0a6f4b
commit
90f0c9d411
714 files changed
+22067
-622
No files matched your search
@@ -0,0 +1,13 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json_view.hpp>
|
||||
|
||||
using ordered_json_document = nlohmann::ordered_json_document;
|
||||
|
||||
int main()
|
||||
{
|
||||
// ordered_json_document is basic_json_document<nlohmann::ordered_json>:
|
||||
// materialize() preserves the insertion (source) order of object keys,
|
||||
// instead of sorting them like json_document does
|
||||
ordered_json_document doc = ordered_json_document::parse(R"({"z": 1, "a": 2, "m": 3})");
|
||||
std::cout << doc.root().materialize().dump() << '\n';
|
||||
}
|
||||
Reference in new issue
Block a user