equal.equal

Compares two ranges for equality. The ranges may have different element types, as long as pred(r1.front, r2.front) evaluates to bool. Performs O(min(r1.length, r2.length)) evaluations of pred.

If the two ranges are different kinds of UTF code unit (char, wchar, or dchar), then the arrays are compared using UTF decoding to avoid accidentally integer-promoting units.

  1. bool equal(Range1 r1, Range2 r2)
    template equal(alias pred = "a == b")
    bool
    equal
    (
    Range1
    Range2
    )
    (
    Range1 r1
    ,
    Range2 r2
    )
    if (
    !useCodePoint!(Range1, Range2) &&
    &&
    &&
    is(typeof(binaryFun!pred(r1.front, r2.front)))
    )
  2. bool equal(Range1 r1, Range2 r2)

Parameters

r1 Range1

The first range to be compared.

r2 Range2

The second range to be compared.

Return Value

Type: bool

true if and only if the two ranges compare equal element for element, according to binary predicate pred.

Meta

Suggestion Box / Bug Report