我有一个 JSON 对象说:
Json::Value temp;
temp["example1"] = "first";
这将表示为
{
"example1" : "first"
}
现在如果我想在不使用 index 方法的情况下将另一个对象添加到上述对象中,我该怎么做呢?例如:
{
"example1" : "first",
"example2" : "second"
}
但避免使用语法
temp["example2"] = "second";
JsonCpp 中是否有任何等价物push_back()
(如在 C++ 向量/列表中)?