swap__reference.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 two JSON values
00008     json j1 = {1, 2, 3, 4, 5};
00009     json j2 = {{"pi", 3.141592653589793}, {"e", 2.718281828459045}};
00010 
00011     // swap the values
00012     j1.swap(j2);
00013 
00014     // output the values
00015     std::cout << "j1 = " << j1 << '\n';
00016     std::cout << "j2 = " << j2 << '\n';
00017 }


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