diff --git a/Sources/DataStructures/AVLTree.swift b/Sources/DataStructures/AVLTree.swift index 014914d..6ea961e 100644 --- a/Sources/DataStructures/AVLTree.swift +++ b/Sources/DataStructures/AVLTree.swift @@ -215,4 +215,12 @@ extension AVLTree: ExpressibleByArrayLiteral { } } +extension AVLTree.Node: Hashable where Key: Hashable, Value: Hashable { + /// Uses the `ObjectIdentifier` of this `Node` to determine hashing. + public func hash(into hasher: inout Hasher) { + hasher.combine(ObjectIdentifier(self)) + } +} + extension AVLTree: Equatable where Value: Equatable { } +extension AVLTree: Hashable where Key: Hashable, Value: Hashable { }