问题
It appears that struct GeneratorOf<T> {…}
is not available in in Swift 2.0. Does anyone know what, if anything, replaces this struct?
Thanks
回答1:
GeneratorOf
was replaced by AnyGenerator
but you have to call a global function instead of the initializer to make one:
anyGenerator(anotherGenerator)
anyGenerator{ /* pass "next function" (as closure) */ }
回答2:
In Swift 2 GeneratorOf
is replaced by class AnyGenerator<Element>
.
来源:https://stackoverflow.com/questions/32255249/swift-2-0-version-of-struct-generatoroft