Hi all,
Go 1.26 is expected early next year and it contains a change in the semantics of the built-in function `new`. Apart from taking a type, new now can take a literal and return a pointer to a value represented by the literal.
Has there been a discussion (ever) of changing the behavior of the `delete`/`clear` functions so that they can return a boolean indicating whether they actually deleted something?
In some cases it is nice to have an indication whether these functions actually deleted anything.
One can achieve this with an additional line of checking whether the values they act upon contain a particular value (for delete) or any value (for clear). But in a similar way new with literal also saves a single line.
Does that make sense? Is there any interest in such a feature?
Kind regards:
al_shopov