find__key_type.cpp
Go to the documentation of this file.
00001 #include <json.hpp>
00002 
00003 using json = nlohmann::json;
00004 
00005 int main()
00006 {
00007     // create a JSON object
00008     json j_object = {{"one", 1}, {"two", 2}};
00009 
00010     // call find
00011     auto it_two = j_object.find("two");
00012     auto it_three = j_object.find("three");
00013 
00014     // print values
00015     std::cout << std::boolalpha;
00016     std::cout << "\"two\" was found: " << (it_two != j_object.end()) << '\n';
00017     std::cout << "value at key \"two\": " << *it_two << '\n';
00018     std::cout << "\"three\" was found: " << (it_three != j_object.end()) << '\n';
00019 }


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:02