Che*_*eng 2 c++
std::map<std::string, int> m; // Can I make assumption that m["NoSuchKey"] will return 0? std::cout << m["NoSuchKey"] << std::endl;
GMa*_*ckG 9
是.当访问的项目operator[]不存在时,将使用默认构造的值创建该项目并返回.
operator[]
对于数字类型,default-construct表示0.
归档时间:
16 年 前
查看次数:
495 次
最近记录: