JSONCPP bug
来源:互联网 发布:金十数据招聘 编辑:程序博客网 时间:2024/05/21 01:56
method_cfg["input_method"][0].asString()
报错误:
test1.cpp:40:46: error: ambiguous overload for ‘operator[]’ in ‘method_cfg.Json::Value::operator[](((const char*)"input_method"))[0]’
test1.cpp:40:46: note: candidates are:
/usr/include/json/value.h:277:14: note: Json::Value& Json::Value::operator[](Json::Value::UInt)
/usr/include/json/value.h:281:20: note: const Json::Value& Json::Value::operator[](Json::Value::UInt) const
/usr/include/json/value.h:294:14: note: Json::Value& Json::Value::operator[](const char*)
/usr/include/json/value.h:296:20: note: const Json::Value& Json::Value::operator[](const char*) const
/usr/include/json/value.h:298:14: note: Json::Value& Json::Value::operator[](const string&)
/usr/include/json/value.h:300:20: note: const Json::Value& Json::Value::operator[](const string&) const
原因和解答:
原因很简单,当是常量值0的时候,无法确定把它当作是 UINT 还是const char*,string来处理。
使用method_cfg["input_method"][0U].asString()或者使用变量 int n=0来代替
- JSONCPP bug
- Jsoncpp库的一个bug
- JSONCPP
- jsoncpp
- jsoncpp
- JsonCpp
- jsoncpp
- 修改一行代码,解决在C++ Builder平台上JSONCPP向数组添加元素的Bug
- jsoncpp数组下标为0时的访问注意事项 这样应该算是严重bug
- Jsoncpp遍历
- jsoncpp例子
- JSONCpp编译
- Jsoncpp更新
- Jsoncpp使用
- JsonCPP 使用
- JSONCPP安装
- JSONCPP使用
- 使用jsoncpp
- Html 中表格导出生成excel文件,解决中文导出失败问题。
- LeetCode 002 Add Two Numbers
- iOS笔记UI--固定宽度,根据内容动态改变高度
- jsp乱码,xml配置方法
- png图片压缩方法
- JSONCPP bug
- 支持向量机:Outliers
- Scale 实例
- Service
- mysql_config_editor 加密用户的密码
- android-消息传递机制Message、MessageQueue、Handler、Looper
- 基本递归和尾递归
- SQL0964C The transaction log for the database is full. SQLSTATE=57011
- mysql 日期时间运算函数