1 #include <iostream> 2 #include <nlohmann/json.hpp> 3 4 using json = nlohmann::json; 5 main()6int main() 7 { 8 // create some JSON values 9 json j_object = R"( {"key": "value"} )"_json; 10 json j_array = R"( [1, 2, 3] )"_json; 11 12 // call contains 13 std::cout << std::boolalpha << 14 "j_object contains 'key': " << j_object.contains("key") << '\n' << 15 "j_object contains 'another': " << j_object.contains("another") << '\n' << 16 "j_array contains 'key': " << j_array.contains("key") << std::endl; 17 } 18