mirror of
https://github.com/nlohmann/json.git
synced 2026-10-04 06:11:14 +01:00
deploy: 63c10a51fc
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
using ordered_json = nlohmann::ordered_json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create a JSON value
|
||||
json j = {{"one", 1}, {"two", 2}, {"three", 3}};
|
||||
|
||||
// convert to a different basic_json specialization
|
||||
ordered_json oj = j.get<ordered_json>();
|
||||
|
||||
std::cout << j << '\n';
|
||||
std::cout << oj << '\n';
|
||||
}
|
||||
Reference in New Issue
Block a user