Код: Выделить всё
try {
conf.x1 = data.at("x1");
conf.x2 = data.at("x2");
// ...
conf.xN = data.at("xN");
} catch (const nlohmann::json::out_of_range &e) {
std::cerr
Подробнее здесь: [url]https://stackoverflow.com/questions/78707025/how-to-handle-nlohmann-exception-type-error-in-a-readable-way[/url]
Мобильная версия