我有以下代码,但无法编译。我想不出原因,请帮助。
rapidjson::Document jsonDoc;
jsonDoc.SetObject();
rapidjson::Document::AllocatorType& allocator = jsonDoc.GetAllocator();
rapidjson::Value messageArr(rapidjson::kArrayType);
std::string test = std::string("TEST");
messageArr.PushBack(test.c_str(), allocator);
Run Code Online (Sandbox Code Playgroud)
给我以下错误;
错误:没有匹配的函数调用 'rapidjson::GenericValue >::PushBack(const char*, Rapidjson::GenericDocument >::AllocatorType&)'
messageArr.PushBack(test.c_str(), allocator);