There are scenarios where retrieving the just-inserted value without first cloning it isn't possible. E.g.: when inserting a value into a non-empty hashset and then needing it again immediately.
But yeah... that's a bit of a contrived example and can be solved by a simple change to the insert function without specialised support from the language.
But yeah... that's a bit of a contrived example and can be solved by a simple change to the insert function without specialised support from the language.