On 8/26/12, Andrej Mitrovic <[email protected]> wrote:
> If I replace it
> with my own hardcoded function below it takes only 5 seconds and uses
> 150 MB RAM. This is what the function looks like:

An even faster version, twice as fast:

template myStaticIndexOf(T, TList...)
{
    static if (!__traits(compiles, TList[0]))
        enum myStaticIndexOf = -1;
    else
    static if (is(T == TList[0]))
        enum myStaticIndexOf = 0;
    else
    // repeat..
}

Reply via email to