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


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