Created
November 9, 2015 03:52
-
-
Save eldesperado/73a350451cbf60e2243b to your computer and use it in GitHub Desktop.
Conformity to CollectionType simply requires implementing the methods of Indexable.
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
extension <# extendedType #> : CollectionType { | |
var startIndex: <# indexType : ForwardIndexType #> { return <# startIndex #> } | |
var endIndex: <# indexType : ForwardIndexType #> { return <# endIndex #> } | |
subscript (index: <# indexType : ForwardIndexType #>) -> <# elementType #> { | |
return <# subscript value #> | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment