swap__string_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 a JSON value
00008     json value = { "the good", "the bad", "the ugly" };
00009 
00010     // create string_t
00011     json::string_t string = "the fast";
00012 
00013     // swap the object stored in the JSON value
00014     value[1].swap(string);
00015 
00016     // output the values
00017     std::cout << "value = " << value << '\n';
00018     std::cout << "string = " << string << '\n';
00019 }


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