2 ms·
C++'s std::[unordered_]{map|multimap|set|multiset} containers all make const copies of keys. Of course, this being C++ you can wiggle out of this requirement (e
by pmjordan 17y ago
C++'s std::[unordered_]{map|multimap|set|multiset} containers all make const copies of keys. Of course, this being C++ you can wiggle out of this requirement (e.g. using the mutable keyword) but you have to be pretty insistant about it.
On the other hand, C++ containers have all sorts of other problems (iterator invalidation to name one)...
C# has the value type concept, but I don't think it's enforced on container keys.