What is the replacement for deprecated array removal

kerdemdemir kerdemdemir at gmail.com
Mon Nov 18 18:21:45 UTC 2019


I know my example can be shortened but please excuse me that I am 
pasting directly

import std.stdio;
import std.math;
import std.range;
import std.algorithm;
import std.typecons;

int[][4] tempMap;

void main()
{
     int[] temp  = [ 1, 2, 3 , 4 ,5 ];
     tempMap[0] =  temp.dup;
     tempMap[1] = temp.dup;
     tempMap[2] = temp.dup;
     tempMap[3] = temp.dup;

     int[] removeList;
     for ( int i = 0; i < tempMap.length; i++ )
     {
         if ( i%2)
             removeList ~=i;
     }
     tempMap[1].remove(removeList);
     writeln(tempMap);

}

Results with that warning:

onlineapp.d(24): Deprecation: function 
std.algorithm.mutation.remove!(cast(SwapStrategy)2, int[], 
int[]).remove is deprecated

How can I remove a list of indexes with remove ?

Erdem









More information about the Digitalmars-d-learn mailing list