digitalmars.D.learn - whay dosn;t this template work?
- BCS (7/7) May 08 2008 T[] RemoveAt(T)(ref T[] dat, int i)
- BCS (5/15) May 08 2008 T RemoveAt(T)(ref T dat, int i)
- Max Samukha (12/19) May 09 2008 The function should return an array.
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 08 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..$]; }
May 09 2008