iw4x-client/deps/json/docs/examples/diagnostics_extended.cpp

23 lines
378 B
C++
Raw Normal View History

2024-03-07 05:13:50 -05:00
#include <iostream>
# define JSON_DIAGNOSTICS 1
#include <nlohmann/json.hpp>
using json = nlohmann::json;
int main()
{
json j;
j["address"]["street"] = "Fake Street";
j["address"]["housenumber"] = "12";
try
{
int housenumber = j["address"]["housenumber"];
}
catch (json::exception& e)
{
std::cout << e.what() << '\n';
}
}