Closed
Description
test code is:
int count = 5;
Json::Value root;
Json::Value item;
root["array"] = Json::Value::nullRef;
for (int i = 0; i < count; i++)
{
item["a"] = i;
item["b"] = i;
root["array"][i] = item;
}
the above code's result is wrong,
{
"array" : [
{
"a" : 0,
"b" : 0
}
]
}
but if when the count = 4, then the result is right:
{
"array" : [
{
"a" : 0,
"b" : 0
},
{
"a" : 1,
"b" : 1
},
{
"a" : 2,
"b" : 2
},
{
"a" : 3,
"b" : 3
}
]
}
Metadata
Metadata
Assignees
Labels
No labels