findAdj

Performs a linear scan of buf from [0 .. buf.length$(RP), returning the index of the first element that compares equal to the next element in the sequence. Comparisons will be performed using the supplied predicate or '==' if none is supplied.

  1. size_t findAdj(Elem[] buf, Pred2E pred)
    version(TangoDoc)
    findAdj
  2. template findAdj(Buf)
  3. template findAdj(Buf, Pred)

Parameters

buf Elem[]

The array to scan.

pred Pred2E

The evaluation predicate, which should return true if e1 is equal to e2 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