This commit is contained in:
nlohmann committed 2026-10-26 21:24:35 +00:00
1 parent 41c601a7d1
commit d2e264bd84
1400 files changed
+11859 -5440

No files matched your search

+3 -3
View File
@@ -89,7 +89,7 @@ When iterating over an array, `key()` will return the index of the element as st
#include <iostream>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
using nlohmann::json;
int main()
{
@@ -98,13 +98,13 @@ When iterating over an array, `key()` will return the index of the element as st
json j_array = {1, 2, 4, 8, 16};
// example for an object
for (auto& x : j_object.items())
for (const auto& x : j_object.items())
{
std::cout << "key: " << x.key() << ", value: " << x.value() << '\n';
}
// example for an array
for (auto& x : j_array.items())
for (const auto& x : j_array.items())
{
std::cout << "key: " << x.key() << ", value: " << x.value() << '\n';
}