I am trying to use rapidjson to output itself to a string to save to a database, using the following code :
StringBuffer buffer;
Writer<FileStream> writer(buffer);
rest.Accept(writer);
string reststring = buffer.GetString();
where rest is a rapidjson::Document.
However I get the following error :
no matching function for call to ‘rapidjson::Writer<rapidjson::FileStream>::Writer (rapidjson::StringBuffer&)’.
which is strange because the author of rapidjson recommended this method in an answer to a previous SO question.
I must have been tired at 9 last night when I wrote this piece of code.
Changing
Writer<FileStream> writer(buffer);
to
Writer<StringBuffer> writer(buffer);
solves the problem.