D idom for removing array elements

albert-j via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 30 04:33:32 PST 2017


On Monday, 30 January 2017 at 12:31:33 UTC, albert-j wrote:

>
> OK, got it. Can you do removal without reallocation with 
> std.container.array?
>
>     Array!int arr;
>     foreach (i; 0..10) arr ~= i;

Sorry, sent too early.

     arr = arr[].remove!(x=> x > 5); //Doesn't work withouth 
calling .Array!int


More information about the Digitalmars-d-learn mailing list