Associative array and ranges

Stanislav Blinov stanislav.blinov at gmail.com
Thu Feb 3 14:19:22 PST 2011


On 02/04/2011 12:48 AM, bearophile wrote:
> Stanislav Blinov:
>
>> Nrgyzer:
>>> Ah, okay... I already tried some things with [0..i] ~ [i + 1..$] but
>>> there was always an error and I thought, it must be done more simply.
>>
>> There is no possible simplier way of removing an arbitrary element from
>> an array than doing that. Well, maybe there is: if your data is POD you
>> could use a memmove with subsequent slice-shrink, but I see we're
>> talking about storing references in this case.
>
> ~ performs a memory allocation, while generally moving items inside an array doesn't require it.
>

Certainly. Forgot to mention that, thanks.


More information about the Digitalmars-d-learn mailing list