[stdlib] Make RandomAccessIndex Comparable

Swift SVN r19647
This commit is contained in:
Dave Abrahams
2014-07-07 23:01:02 +00:00
parent e67975d5cb
commit 94e04be86d

View File

@@ -233,10 +233,15 @@ func ~> <T: _BidirectionalIndex>(
func advancedBy(DistanceType) -> Self
}
@public protocol RandomAccessIndex : BidirectionalIndex, _RandomAccessIndex {
@public protocol RandomAccessIndex
: BidirectionalIndex, _RandomAccessIndex, Comparable {
/* typealias DistanceType : IntegerArithmetic*/
}
func < <T: _RandomAccessIndex>(x: T, y: T) -> Bool {
return x.distanceTo(y) > 0
}
// advance and distance implementations
/// Do not use this operator directly; call distance(start, end) instead