开发者

Does it make sense to make std::map key const? [duplicate]

开发者 https://www.devze.com 2023-03-12 04:59 出处:网络
This question already has answers here: What开发者_C百科 is difference between const and non const key?
This question already has answers here: What开发者_C百科 is difference between const and non const key? (7 answers) Closed 9 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消