insert.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     // insert number 10 before number 3
00011     auto new_pos = v.insert(v.begin() + 2, 10);
00012 
00013     // output new array and result of insert call
00014     std::cout << *new_pos << '\n';
00015     std::cout << v << '\n';
00016 }


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