if(mp[ch])
This will call the map::operator[]
with key ch
.
If key matches to an element in map
it will return the value of that element.
If key does not match to any element in the map, the function inserts a new element with that key and returns a reference to its mapped value.
You can use map::find
to check if the key is present or not in the map.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…