Skip to content

Instantly share code, notes, and snippets.

@polac24
Created March 31, 2019 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polac24/51408a7c0c7282282368393887ea76ed to your computer and use it in GitHub Desktop.
Save polac24/51408a7c0c7282282368393887ea76ed to your computer and use it in GitHub Desktop.
class ArgRecords<T>{
private(set) var history: [T] = []
func record(_ t: T){
history.append(t)
}
subscript(_ i: Int) -> T? {
guard i < history.count else {return nil}
return history[i]
}
var count: Int {
return history.count
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment