rapidjson – writing directly to buffer I am using rapidjson library for creating json. I have a function that construct std::string: