object.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 JSON objects
00008     json j_no_init_list = json::object();
00009     json j_empty_init_list = json::object({});
00010     json j_list_of_pairs = json::object({ {"one", 1}, {"two", 2} });
00011     //json j_invalid_list = json::object({ "one", 1 }); // would throw
00012 
00013     // serialize the JSON objects
00014     std::cout << j_no_init_list << '\n';
00015     std::cout << j_empty_init_list << '\n';
00016     std::cout << j_list_of_pairs << '\n';
00017 }


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