I\'m making a class and I want to return my class inside a method. My class has a rapidjson::Document
object.
You can see the previous problems here: L
I created this method to copy document object and it works fine for me:
static void copyDocument(rapidjson::Document & newDocument, rapidjson::Document & copiedDocument) {
rapidjson::StringBuffer strbuf;
rapidjson::Writer writer(strbuf);
newDocument.Accept(writer);
std::string str = strbuf.GetString();
copiedDocument.Parse<0>(str.c_str());
}