This question already has an answer here:
- What is difference between const and non const key? 7 answers
When defining a std::map
, does it make sense to make the key type const
?
This question already has an answer here:
When defining a std::map
, does it make sense to make the key type const
?
The key is already const
, actually, because a key cannot change once an element was inserted in the map.