countIf

Performs a linear scan of buf from [0 .. buf.length$(RP), returning a count of the number of elements where pred returns true.

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

Parameters

buf Elem[]

The array to scan.

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 number of elements where pred returns true.

Meta