[swift-evolution] Let range operators always return empty ranges if the upper bound is smaller than the lower bound.

Dave Abrahams dabrahams at apple.com
Thu Jan 21 15:24:49 CST 2016


on Thu Jan 21 2016, Haravikk <swift-evolution at swift.org> wrote:

> The tricky thing with ranges at the moment is that they can’t actually
> represent a full range of an integer type, for example a Range<UInt8>
> can only represent a range from 0 to 254 (endIndex is 255 but is
> exclusive). 

FWIW, I'm interested in addressing this issue for Swift 3 in conjunction
with the new indexing model that Dmitri has been developing in
https://github.com/apple/swift/blob/master/test/Prototypes/CollectionsMoveIndices.swift

Cheers,
Dave



More information about the swift-evolution mailing list