介绍了通过for基于元素迭代的方式进行遍历。
还可以通过begin/end迭代器对object/array进行遍历:
#include <iostream>
#include <nlohmann/json.hpp>
using namespace std;
using json = nlohmann::json;
auto checkJsonType(json& x)
{
if(x.type() == json::value_t::null)
{
cout<<x<<" is null"<<endl;
}
else if(x.type() == json::value_t::object)
{
cout<<x<<" is object"<<endl;
}
else if(x.type()