1c5f01b2fSopenharmony_ci#include <iostream>
2c5f01b2fSopenharmony_ci#include <nlohmann/json.hpp>
3c5f01b2fSopenharmony_ci
4c5f01b2fSopenharmony_ciusing json = nlohmann::json;
5c5f01b2fSopenharmony_ci
6c5f01b2fSopenharmony_ciint main()
7c5f01b2fSopenharmony_ci{
8c5f01b2fSopenharmony_ci    // create an array value
9c5f01b2fSopenharmony_ci    const json array = {1, 2, 3, 4, 5};
10c5f01b2fSopenharmony_ci
11c5f01b2fSopenharmony_ci    // get an iterator to the first element
12c5f01b2fSopenharmony_ci    json::const_iterator it = array.cbegin();
13c5f01b2fSopenharmony_ci
14c5f01b2fSopenharmony_ci    // serialize the element that the iterator points to
15c5f01b2fSopenharmony_ci    std::cout << *it << '\n';
16c5f01b2fSopenharmony_ci}
17