MCPcopy Create free account
hub / github.com/danielaparker/jsoncons / add_element_to_array

Function add_element_to_array

examples/src/array_examples.cpp:93–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void add_element_to_array()
94{
95 json cities(json_array_arg); // an empty array
96 std::cout << cities << '\n'; // output is "[]"
97 cities.push_back("Toronto");
98 cities.push_back("Vancouver");
99 cities.insert(cities.array_range().begin(),"Montreal"); // inserts "Montreal" at beginning of array
100
101 std::cout << cities << '\n';
102}
103
104void reverse_array_iterator()
105{

Callers 1

mainFunction · 0.85

Calls 3

push_backMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected