Created
March 31, 2019 18:01
-
-
Save polac24/51408a7c0c7282282368393887ea76ed to your computer and use it in GitHub Desktop.
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
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