]> git.proxmox.com Git - ceph.git/blame - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/insert__count.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / nlohmann-json / doc / examples / insert__count.cpp
CommitLineData
1e59de90
TL
1#include <iostream>
2#include <nlohmann/json.hpp>
3
4using json = nlohmann::json;
5
6int main()
7{
8 // create a JSON array
9 json v = {1, 2, 3, 4};
10
11 // insert number 7 copies of number 7 before number 3
12 auto new_pos = v.insert(v.begin() + 2, 7, 7);
13
14 // output new array and result of insert call
15 std::cout << *new_pos << '\n';
16 std::cout << v << '\n';
17}