Do we have a simple find/remove algorithm?
Paolo Invernizzi
paolo.invernizzi at gmail.com
Sat Sep 26 15:43:18 UTC 2020
On Saturday, 26 September 2020 at 14:00:34 UTC, Sebastiaan Koppe
wrote:
> On Saturday, 26 September 2020 at 12:22:52 UTC, Andrei
> Alexandrescu wrote:
>> On 9/25/20 11:45 PM, mipri wrote:
>>> This removes two elements however:
>>>
>>> [1,2,3,4,5,3].remove!(x => x==3)
>>
>> Yah, removing all is not too difficult. Removing one is oddly
>> missing. I think we should add a findRemove algorithm.
>> Question is, should it go in iteration.d or mutation.d? :o)
>
> I usually do r.remove(r.countUntil(3)), but its not intuitive.
Same here ...
More information about the Digitalmars-d
mailing list