unordered_map key无法取得时的的默认值
代码语言:javascript复制int main() {
unordered_map<string, string> m1;
unordered_map<string, bool> m2;
unordered_map<string, int> m3;
cout << (m1["a"] == "") << endl; // output 1
cout << (m2["a"] == false) << endl; // output 1
cout << (m3["a"] == 0) << endl; // output 1
}
output