I would like to have an array of SomeProtocol which has a get property represents in Task extension.
If hashValue of Task is unique, I would like to consider it as a primary key to remove object in SomeProtocol array. And I wonder it is guaranteed on memory level, too.
Here's code below.
protocol SomeProtocol {
var taskId: Int { get }
}
extension Task: SomeProtocol {
var taskId: Int {
get { return hashValue }
}
}