push_back__object_t__value.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 object = {{"one", 1}, {"two", 2}};
00009     json null;
00010 
00011     // print values
00012     std::cout << object << '\n';
00013     std::cout << null << '\n';
00014 
00015     // add values
00016     object.push_back(json::object_t::value_type("three", 3));
00017     object += json::object_t::value_type("four", 4);
00018     null += json::object_t::value_type("A", "a");
00019     null += json::object_t::value_type("B", "b");
00020 
00021     // print values
00022     std::cout << object << '\n';
00023     std::cout << null << '\n';
00024 }


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