Example from d-idioms is incorrect

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 30 14:40:15 PDT 2015


On Thursday, 30 April 2015 at 21:30:36 UTC, TheGag96 wrote:
>   arr.remove(1);

You didn't assign the result here... the site says

arr = arr.remove(index);


Notice too that the docs do NOT take the array by reference; they 
don't necessarily modify it in-place.

http://dlang.org/phobos/std_algorithm_mutation.html#.remove

So the assignment is important to have.


More information about the Digitalmars-d-learn mailing list