Closed ptazithos closed 2 years ago
I would say it's expected. Values are stored in insertion order, so when I call .insert()
I'd expect it to be ordered last
I would say it's expected. Values are stored in insertion order, so when I call
.insert()
I'd expect it to be ordered last
That makes sense. Thank you!
Description:
Inserting a exising key will change the order of keys.
Now, the order of the keys is "a", "b" and "c". Then we update the value of "b" by insert method:
The order of the keys changes to "a", "c" and "b". Intutively, I think the the behavior of
map.insert("b",0);
should be equivalent tomap["b"] = 0;
except the way they handle exceptions. Is this a feature or a bug?