mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Make RandomAccessIndex Comparable
Swift SVN r19647
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user