When defining a std::map, does it make sense to make the key type const?
Asked
Active
Viewed 1,641 times
5
Evan Teran
- 84,149
- 29
- 174
- 237
Graeme
- 4,276
- 3
- 38
- 66
1 Answers
9
The key is already const, actually, because a key cannot change once an element was inserted in the map.
Etienne de Martel
- 32,266
- 8
- 91
- 105