Closed Philippe91 closed 1 year ago
Good point, for unordered_dense::set iterator
and const_iterator
could be the same type. I'll see what I can do here.
I can't internally use const types though because the map/set has to move elements around. Whenever you delete one entry, the map/set will move an element into the empty place.
Fixed in #53
I am aware of this design: "no const Key in std::pair<Key, Value>". I did not care until today. For a map, this is fine; I mean, willing to change the key is not common. But for a set, the situation is more bug-prone.
For example, this does not compile and this is good:
While the following is compiling fine, hence there is a risk of introducing a subtle bug for a common for-loop scenario.
Hence I am wondering: what is the reason for not being able to have a const key? No way to change that, at least for a set?