insert__count.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 7 copies of number 7 before number 3
00011     auto new_pos = v.insert(v.begin() + 2, 7, 7);
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