Function std.algorithm.comparison.equal.equal
Compares two or more ranges for equality. The ranges may have
different element types, as long as all are comparable by means of
the pred
.
Performs Ο(min(rs[0]
) evaluations of pred
. However, if
equal
is invoked with the default predicate, the implementation may take the liberty
to use faster implementations that have the theoretical worst-case
Ο(max(rs[0]
).
bool equal(Ranges...)
(
Ranges rs
)
if (rs .length > 1 && allSatisfy!(isInputRange, Ranges) && !allSatisfy!(isInfinite, Ranges) && is(typeof(binaryFun!pred(rs[0] .front, rs[1] .front))) && (rs .length == 2 || is(typeof(equal!pred(rs[1..__dollar])) == bool)));
At least one of the ranges must be finite. If one range involved is infinite, the result is
(statically known to be) false
.
If the ranges have different kinds of UTF code unit (char
, wchar
, or
dchar
), then they are compared using UTF decoding to avoid
accidentally integer-promoting units.
Parameters
Name | Description |
---|---|
rs | The ranges to be compared. |
Returns
true
if and only if all ranges compare equal element
for element, according to binary predicate pred
.