1
0
mirror of https://github.com/nlohmann/json synced 2024-11-22 20:10:06 +00:00
nlohmannjson/docs/examples/operator_literal_json.cpp

14 lines
254 B
C++
Raw Normal View History

#include <iostream>
#include <iomanip>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using namespace nlohmann::literals;
int main()
{
json j = R"( {"hello": "world", "answer": 42} )"_json;
std::cout << std::setw(2) << j << '\n';
}