This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol ConvertibleFromRawInt { | |
static func fromRaw(raw: Int) -> Self? | |
} | |
// Note: Tried to use Swift's standard RawRepresentable protocol rather | |
// than ConvertibleFromRawInt, but couldn't get it to compile. | |
// Don't know whether it is a Swift bug or something I was doing wrong. | |
// Generator for a sequence of contiguous ConvertibleFromRawInt values | |
class ConvertibleFromRawIntGenerator<T: ConvertibleFromRawInt>: GeneratorType { |