When defining a std::map, does it make sense to make the key type const?
Asked
Active
Viewed 1,718 times
5
Evan Teran
- 87,561
- 32
- 179
- 238
Graeme
- 4,514
- 5
- 43
- 71
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
- 34,692
- 8
- 91
- 111