mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add requirement StringProtocol.SubSequence : StringProtocol
This commit is contained in:
@@ -18,10 +18,14 @@ extension MyString : BidirectionalCollection {
|
||||
typealias Iterator = String.Iterator
|
||||
typealias Index = String.Index
|
||||
typealias IndexDistance = String.IndexDistance
|
||||
typealias SubSequence = MyString
|
||||
func makeIterator() -> Iterator { return base.makeIterator() }
|
||||
var startIndex: String.Index { return base.startIndex }
|
||||
var endIndex: String.Index { return base.startIndex }
|
||||
subscript(i: Index) -> Character { return base[i] }
|
||||
subscript(indices: Range<Index>) -> MyString {
|
||||
return MyString(base: String(self.base[indices]))
|
||||
}
|
||||
func index(after i: Index) -> Index { return base.index(after: i) }
|
||||
func index(before i: Index) -> Index { return base.index(before: i) }
|
||||
func index(_ i: Index, offsetBy n: IndexDistance) -> Index {
|
||||
|
||||
Reference in New Issue
Block a user