/
githubmirror
/
json
Обзор
Документация
Войти
/
githubmirror
/
json
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
3.6.1
doc/examples/contains.cpp
17 строк
527 B
Niels Lohmann
:memo: added documentation
18 мар 2019, 00:25
Не верифицирован
18 мар 2019, 00:25
22c733e
Код
Авторство
О чём код?
#include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create some JSON values json j_object = R"( {"key": "value"} )"_json; json j_array = R"( [1, 2, 3] )"_json; // call contains std::cout << std::boolalpha << "j_object contains 'key': " << j_object.contains("key") << '\n' << "j_object contains 'another': " << j_object.contains("another") << '\n' << "j_array contains 'key': " << j_array.contains("key") << std::endl; }