Hi,everyone,
This code must add the 'break',
import std.stdio;
int x=0;
template isin(T){
    bool isin(T[] Array,T Element){
        bool rtn=false;
        foreach(T ArrayElement; Array){
            if(Element==ArrayElement){
                rtn=true; break;      ← //here add break
            }
         x++;
        }
    return rtn;
    }
}

void main(string[] args)
{
    int[] stuff=[0,1,2,3,4,5,6,7,8,9,10];  ← //here declare int[]

    if (stuff.isin(2)) // Much clean!
    {
                writeln(x);
        writeln("Hello World!");
    }
}
----------------end---------------

Frank

Reply via email to