Possible change to array runtime?
monarch_dodra
monarchdodra at gmail.com
Thu Mar 13 08:53:15 PDT 2014
On Thursday, 13 March 2014 at 15:24:01 UTC, Steven Schveighoffer
wrote:
>
> Destroy.
>
> -Steve
Please keep in mind that if the objects stored are RAII, then
if/when we will have a finalizing GC, the stomped elements will
have been leaked.
Clobbering elements is more than just "I won't use these elements
anymore", it's "I won't use them, and they are safe to be
discarded of right now".
In know that's a big "if", but it could happen. If we go the way
of your proposal, we are definitively closing that door.
--------
Semi-on topic, it would greatly help if assumeSafeAppend was
nothrow. As of right now, there are a lot of places in phobos
where it could be used, but isn't, because of this. In
particular, assumeSafeAppend can be used to both shrink an array,
*or* grow an array up-to capacity.
Its greater use in phobos would help give it more visibility and
exposure.
More information about the Digitalmars-d
mailing list