simple syntax issue with template

2011-06-13 Thread Lloyd Dupont
I'm trying to create 2 extra method for arrays (range would be better, though I don't quite understand what is a range) Although I have some indecipherable (to me) compiler error... What's wrong with the code below? == import std.algorithm; public: void remove(T)(ref T[]

Re: simple syntax issue with template

2011-06-13 Thread Dmitry Olshansky
On 13.06.2011 16:03, Lloyd Dupont wrote: I'm trying to create 2 extra method for arrays (range would be better, though I don't quite understand what is a range) Although I have some indecipherable (to me) compiler error... What's wrong with the code below? == import

Re: simple syntax issue with template

2011-06-13 Thread Lloyd Dupont
removed some obvious error, still stumped on the templated syntax ... so.. why is it not compiling? (error: Error: template std.algorithm.countUntil(alias pred = a == b,R1,R2) if (is(typeof(startsWith!(pred)(haystack,needle does not match any function template declaration ) = import

Re: simple syntax issue with template

2011-06-13 Thread Lloyd Dupont
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;

Re: simple syntax issue with template

2011-06-13 Thread Dmitry Olshansky
On 13.06.2011 16:49, Lloyd Dupont wrote: ho.. plenty of silly mistake indeed.. thanks for spotting them! (maybe I should take a break and play the witcher 2 hey!?!? :) Why not ? ;-) however I still have a problem with removeAt now! :( === void removeAt(T)(ref T[] array, int index) {

Re: simple syntax issue with template

2011-06-13 Thread Joshua Niehus
I'm trying to create 2 extra method for arrays (range would be better, though I don't quite understand what is a range) Although I have some indecipherable (to me) compiler error... What's wrong with the code below? == import std.algorithm; public: void remove(T)(ref T[]