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 asbool 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 itIOW, equal() has a defined by-element-comparison semantics, while opEquals doesn't.