Another one that make sense to add, when SE-0134 is implemented, is Hashable
, so that we can have Set
s and Dictionary(s)
of Optional
s:
extension Optional: Hashable where Wrapped: Hashable {
var hashValue: Int {
return self?.hashValue ?? 0
}
}
I'm sure there are more, which makes me wonder: is something like this scalable? Will we end up with a hundred different extensions to Optional
for each protocol which has a "default" for Optional
?