Do we have a simple find/remove algorithm?

Sebastiaan Koppe mail at skoppe.eu
Sat Sep 26 14:00:34 UTC 2020


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.


More information about the Digitalmars-d mailing list