On Tuesday, 18 February 2014 at 09:31:55 UTC, Per Nordlöw wrote:
I'm curious to why we need std.range.equal in cases such as

bool isPalindrome(Range)(in Range range) if (isBidirectionalRange!Range)
{
    return range.retro.equal(range);
}

Why isn't equality == operator used here instead?

/Per

1) opEquals cannot be a free function
2) there's no telling what opEquals does if Range defines it

IOW, equal() has a defined by-element-comparison semantics, while opEquals doesn't.

Reply via email to