The OpenD Programming Language

staticIndexOf

Returns the index of the first occurrence of args[0] in the sequence args[1 .. $]. args may be types or compile-time values. If not found, -1 is returned.

template staticIndexOf (
args...
) if (
args.length >= 1
) {
enum staticIndexOf;
}

Examples

import std.stdio;

void foo()
{
    writefln("The index of long is %s",
             staticIndexOf!(long, AliasSeq!(int, long, double)));
    // prints: The index of long is 1
}

Meta