Why is std.algorithm so complicated to use?

Mehrdad wfunction at hotmail.com
Sun Jul 15 16:47:15 PDT 2012


On Sunday, 15 July 2012 at 22:39:47 UTC, Jonathan M Davis wrote:
> On Sunday, July 15, 2012 18:24:47 Andrei Alexandrescu wrote:
>> On 7/15/12 6:22 PM, Mehrdad wrote:
>> > On Sunday, 15 July 2012 at 22:03:33 UTC, Jonathan M Davis 
>> > wrote:
>> >> auto arr = [10, 22, 19, 4, 6];
>> >> arr = remove(arr, 3);
>> >> assert(arr == [10, 22, 19, 6]);
>> > 
>> > Yeah, the problem is that this reallocates...
>> 
>> doesn't
>
> Yeah. It just slices.

Ooooooh, I misunderstood what was happening. Thanks to both you & 
Andrei!


More information about the Digitalmars-d mailing list