Last active
February 26, 2017 01:40
-
-
Save ukitaka/e7b76ebbf541d3617f18f9d2e54c1c53 to your computer and use it in GitHub Desktop.
SequenceProxy
This file contains hidden or 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
| public protocol SequenceProxy: Sequence { | |
| associatedtype Element | |
| var elements: [Element] { get } | |
| } | |
| public extension SequenceProxy { | |
| func makeIterator() -> IndexingIterator<Array<Element>> { | |
| return elements.makeIterator() | |
| } | |
| } | |
| struct MyCustomSequence: SequenceProxy { | |
| let elements: [Int] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment