Created
March 10, 2018 02:34
-
-
Save efremidze/ba5701e3f528b59a0b3e41824d215a33 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 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