staticIndexOf

Returns the index of the first occurrence of T in L. -1 is returned if T is not found.

  1. template staticIndexOf(T, L...)
    template staticIndexOf (
    T
    L...
    ) {}
  2. template staticIndexOf(alias T, L...)

Members

Variables

staticIndexOf
enum ptrdiff_t staticIndexOf;
Undocumented in source.

Parameters

T

The item to search for.

L

Symbol sequence.

Return Value

The index of the first occurrence of T in L.

Examples

static assert(staticIndexOf!(int) == -1);
static assert(staticIndexOf!(int, int) == 0);
static assert(staticIndexOf!(int, float, double, int, real) == 2);
static assert(staticIndexOf!(3, () {}, uint, 5, 3) == 3);

Meta