Thread overview
whay dosn;t this template work?
May 08, 2008
BCS
nevre mind
May 08, 2008
BCS
May 09, 2008
Max Samukha
May 08, 2008
T[] RemoveAt(T)(ref T[] dat, int i)
{
	dat = dat[0..i] ~ dat[i+1..$];
}


char[][] args

args.RemoveAt(0);

(D v1)


May 08, 2008
Reply to Benjamin,

> T[] RemoveAt(T)(ref T[] dat, int i)
> {
> dat = dat[0..i] ~ dat[i+1..$];
> }
> char[][] args
> 
> args.RemoveAt(0);
> 
> (D v1)
> 


T RemoveAt(T)(ref T dat, int i)
{
return dat = dat[0..i] ~ dat[i+1..$];
}


May 09, 2008
On Thu, 8 May 2008 22:14:06 +0000 (UTC), BCS <ao@pathlink.com> wrote:

>
>T[] RemoveAt(T)(ref T[] dat, int i)
>{
>	dat = dat[0..i] ~ dat[i+1..$];
>}
>
>
>char[][] args
>
>args.RemoveAt(0);
>
>(D v1)
>

The function should return an array.

T[] RemoveAt(T)(ref T[] dat, int i)
{
     dat = dat[0..i] ~ dat[i+1..$];
      return dat;
}

or

void RemoveAt(T)(ref T[] dat, int i)
{
     dat = dat[0..i] ~ dat[i+1..$];
}