findIf

Performs a linear scan of buf from [0 .. buf.length$(RP), returning the index of the first element where pred returns true.

  1. size_t findIf(Elem[] buf, Pred1E pred)
    version(TangoDoc)
    findIf
  2. template findIf(Buf, Pred)

Parameters

buf Elem[]

The array to search.

pred Pred1E

The evaluation predicate, which should return true if the element is a valid match and false if not. This predicate may be any callable type.

Return Value

Type: size_t

The index of the first match or buf.length if no match was found.

Meta