Had another 48hr game jam this weekend...
Dmitry Olshansky
dmitry.olsh at gmail.com
Sun Sep 1 05:01:45 PDT 2013
01-Sep-2013 06:57, Andrej Mitrovic пишет:
> On 9/1/13, Manu <turkeyman at gmail.com> wrote:
> auto idx = array.countUntil(item);
> if (idx != -1)
> array = array.remove(idx);
We just need better documentation/examples..
E.g. this works fine:
int[] arr = [1, 2, 3, 1, 4 ];
arr = remove!(x => x == 1)(arr);
assert(arr == [2, 3, 4]);
And one can even ask it to do unstable removal which is faster.
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list