我写了两段代码做实验,是内容最简的,理论上可以成功编译的实现。但是Xcode会说"Type 'MyCollection' does not conform to protocol 'SequenceType'。
struct MyGenerator : GeneratorType {
mutating func next() -> Int? {
fatalError("TBI")
}
}
struct MyCollection<T> : SequenceType {
typealias SubSequence = MyCollection<T>
func generate() -> MyGenerator {
fatalError("TBI")
}
}
请问我这上面少实现了什么?或者能不能给我一个成功实现的例子?
文档看错了。
dropFirst:
,dropLast:
什么的都没有default implementation。。。。。。。。。