I'm trying to pass a Document as a parameter (in this case to a C++ Class C'tor, but doens't really matter), and move it, so the orig Document will become Null, and the class member will hold the document.
Example:
class A
{
rapidjson::Document m_payload;
A(rapidjson::Document& payload)
{
m_payload = payload; // DOESN'T WORK ('operator =' is a private member of 'rapidjson::GenericDocument<...>')
}
};
I know that if it would have been a Value, the operator= would have worked, but can't get it to work with Document.
Workarounds I found so far:
m_payload.Swap(payload); // This works specifically here, but not what I wanted.
m_payload = std::move(payload); // I prefer not to use C++11 operations.
Obviously I prefer to move and not copy considering performance.