小编nil*_*lan的帖子

RapidJson kArrayType 带字符串

我有以下代码,但无法编译。我想不出原因,请帮助。

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);

c++ stdstring rapidjson

3
推荐指数
1
解决办法
5082
查看次数

标签 统计

c++ ×1

rapidjson ×1

stdstring ×1