ho.. plenty of silly mistake indeed.. thanks for spotting them!
(maybe I should take a break and play the witcher 2 hey!?!? :)

however I still have a problem with removeAt now! :(
===
void removeAt(T)(ref T[] array, int index)
{
   if(index < 0 || index >= array.length)
       return;
   array.replaceInPlace(index, index + 1, []);
}
===
will produce the following errors:
===
Error: template std.array.replaceInPlace(T,Range) if (isDynamicArray!(Range) && is(ElementEncodingType!(Range) : T) && !is(T == const(T)) && !is(T == immutable(T))) does not match any function template declaration Error: template std.array.replaceInPlace(T,Range) if (isDynamicArray!(Range) && is(ElementEncodingType!(Range) : T) && !is(T == const(T)) && !is(T == immutable(T))) cannot deduce template function from argument types !()(int[],int,int,void[])
===

mmm.. strangely enough the code below succeed!
====
void removeAt(T)(ref T[] array, int index)
{
   if(index < 0 || index >= array.length)
       return;
   T[] empty;
   array.replaceInPlace(index, index + 1, empty);
}
====
but T[].init didn't work either....?! ho well, thanks! :)

Reply via email to