I have something as the following using rapidjson
rapidjson::Value parent;
parent.SetObject();
rapidjson::Value child;
child.SetObject();
parent.AddMember("child", child, document.GetAllocator());
The problem is when I call parent.AddMember()
, the library nullifies my child
variable because rapidjson uses move semantics.
How can I still keep a reference to the child
value when it gets moved?
Ideally, I'd like to keep a reference to the child
node so that I can modify it later, without having to go find it in the JSON tree.