Do we have a simple find/remove algorithm?
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Sat Sep 26 16:02:23 UTC 2020
On 9/26/20 10:00 AM, 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.
Good to know, thanks.
More information about the Digitalmars-d
mailing list