mirror of
https://github.com/nlohmann/json.git
synced 2026-10-06 22:47:13 +00:00
deploy: 8d7e0046f4
This commit is contained in:
1 parent
f2f73132b2
commit
4deadb2473
254 files changed
+678
-475
No files matched your search
@@ -0,0 +1,16 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
using json = nlohmann::json;
|
||||
|
||||
int main()
|
||||
{
|
||||
// create a JSON value
|
||||
json j = {{"one", 1}, {"two", 2}};
|
||||
|
||||
// format_as() is found via argument-dependent lookup, the same way
|
||||
// fmt::format/fmt::print would find it
|
||||
auto j_str = format_as(j);
|
||||
|
||||
std::cout << j_str << std::endl;
|
||||
}
|
||||
Reference in new issue
Block a user