Returns a Boolean value indicating whether two type-erased hashable instances wrap the same type and value.
- Xcode 8.0+
- Swift Standard Library
A type-erased hashable value.
Another type-erased hashable value.
Two instances of
Any compare as equal if and only if the underlying types have the same conformance to the
Equatable protocol and the underlying values compare as equal.
The following example creates two type-erased hashable values:
x wraps an
Int with the value 42, while
y wraps a
UInt8 with the same numeric value. Because the underlying types of
y are different, the two variables do not compare as equal despite having equal underlying values.