On 1 September 2013 22:01, Dmitry Olshansky <[email protected]> wrote:
> 01-Sep-2013 06:57, Andrej Mitrovic пишет: > >> On 9/1/13, Manu <[email protected]> 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. I'd agree that's fairly acceptable. It's just not obvious/intuitive. My bad, I should be more familiar with phobos than I am...
