replaceIf

Performs a linear scan of buf from [0 .. buf.length$(RP), replacing elements where pred returns true with val.

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

Parameters

buf Elem[]

The array to scan.

val Elem

The value to substitute.

pred Pred2E

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 replaced.

Meta