basic_json__list_init_t.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 values
00008     json j_empty_init_list = json({});
00009     json j_object = { {"one", 1}, {"two", 2} };
00010     json j_array = {1, 2, 3, 4};
00011     json j_nested_object = { {"one", {1}}, {"two", {1, 2}} };
00012     json j_nested_array = { {{1}, "one"}, {{1, 2}, "two"} };
00013 
00014     // serialize the JSON value
00015     std::cout << j_empty_init_list << '\n';
00016     std::cout << j_object << '\n';
00017     std::cout << j_array << '\n';
00018     std::cout << j_nested_object << '\n';
00019     std::cout << j_nested_array << '\n';
00020 }


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