关于 map 的迭代器
今天遇到一个问题
CountCompileResult(const LIST_MAP & rfLmCompileWafers)
{
for (auto itr = rfLmCompileWafers.begin(); itr != rfLmCompileWafers.end(); ++itr)
{
if ((*itr)["DEST_TYPE"].compare(GRADE_1) == 0 || (*itr)["DEST_TYPE"].compare(GRADE_2) == 0 ||
(*itr)["DEST_TYPE"].compare(GRADE_3) == 0)
}
}
当传参类型为 const 时,重载 [] 运算符不能使用,去掉const 可以正常编译,因为不存在const 类型的重载。
浙公网安备 33010602011771号