insert__range.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 array
00008     json v = {1, 2, 3, 4};
00009 
00010     // create a JSON array to copy values from
00011     json v2 = {"one", "two", "three", "four"};
00012 
00013     // insert range from v2 before the end of array v
00014     auto new_pos = v.insert(v.end(), v2.begin(), v2.end());
00015 
00016     // output new array and result of insert call
00017     std::cout << *new_pos << '\n';
00018     std::cout << v << '\n';
00019 }


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