Skip to content

Instantly share code, notes, and snippets.

@efremidze
Created March 10, 2018 02:34
Show Gist options
  • Save efremidze/ba5701e3f528b59a0b3e41824d215a33 to your computer and use it in GitHub Desktop.
Save efremidze/ba5701e3f528b59a0b3e41824d215a33 to your computer and use it in GitHub Desktop.
class Counter<T: Hashable> {
let id: T
private(set) var count: Int = 0
init(id: T) {
self.id = id
}
func increment() {
count += 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment