indexOf

Complement to std.string.indexOf which works with arrays of non-character types. Unlike std.algorithm.countUntil, it does not auto-decode, and returns an index usable for array indexing/slicing.

  1. ptrdiff_t indexOf(T[] arr, D val)
    ptrdiff_t
    indexOf
    (
    T
    D
    )
    (
    in T[] arr
    ,
    in D val
    )
    if (
    !isSomeChar!T &&
    is(typeof(arr.countUntil(val)))
    &&
    is(typeof(arr[0] == val))
    )
  2. ptrdiff_t indexOf(T[] arr, T[] val)

Meta