Skip to content

Instantly share code, notes, and snippets.

@segiddins
Created April 9, 2015 15:27
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save segiddins/45c19264457deb8ccc63 to your computer and use it in GitHub Desktop.
func drop<S: SequenceType, T where S.Generator.Element == T>(sequence: S, count: Int) -> GeneratorOf<T> {
var generator = sequence.generate()
for _ in 0..<count {
generator.next()
}
return GeneratorOf<T>(generator)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment