count

Performs a linear scan of buf from [0 .. buf.length$(RP), returning a count of the number of elements matching pat. Comparisons will be performed using the supplied predicate or '==' if none is supplied.

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

Parameters

buf Elem[]

The array to scan.

pat Elem

The pattern to match.

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 number of elements matching pat.

Meta