error: ambiguous overload for ‘operator[]’ (operand types are ‘CConfigTable {aka Json::Value}’ and ‘int’)原因;
Json中包含数组的情况下,需要设置数组中内容,用以下方式;
alarmout[0][“Name”] = “Noname”;
编译报错:
error: ambiguous overload for ‘operator[]’ (operand types are ‘CConfigTable {aka Json::Value}’ and ‘int’);
错误原因是这里的value的参数同时包含string和int,识别不出来,改成alarmout[0u][“Name”] = “Noname”]就能解决了!
第二次在这个小问题上发时间定位,记录下!上点心;