/
githubmirror
/
json
Обзор
Документация
Войти
/
githubmirror
/
json
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.1.1
doc/examples/exception.cpp
20 строк
432 B
Niels Lohmann
:bookmark: set version to 3.1.0
02 фев 2018, 00:20
Не верифицирован
02 фев 2018, 00:20
0258484
Код
Авторство
О чём код?
#include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { try { // calling at() for a non-existing key json j = {{"foo", "bar"}}; json k = j.at("non-existing"); } catch (json::exception& e) { // output exception information std::cout << "message: " << e.what() << '\n' << "exception id: " << e.id << std::endl; } }