Remove instance from array

Jolly James via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jul 5 09:17:29 PDT 2017


On Wednesday, 5 July 2017 at 16:04:16 UTC, Jolly James wrote:
> On Wednesday, 5 July 2017 at 15:56:45 UTC, Igor Shirkalin wrote:
>> [...]
>
> Thank you! :)
>
>
> But why a containers so complicated in D?
>
> [...]



Part of CoreCLR's 'List<T>':

>        public bool Remove(T item)
>        {
>            int index = IndexOf(item);
>            if (index >= 0)
>            {
>                RemoveAt(index);
>                return true;
>            }
>
>            return false;
>        }
> // 
> https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Collections/Generic/List.cs


If there isn't already, maybe something similar to this should 
get part of Phobos. I think this could be really useful.


More information about the Digitalmars-d-learn mailing list