Difference between using ObjectIdentifier() and '===' Operator
问题 Let's say I'm implementing a root class in Swift, which I declare adopts the Equatable protocol (I want to be able to tell if an array of my type contains a given instance or not). What is the difference -if any, in this specific case- between implementing the protocol's required == operator as: public static func ==(lhs: MyClass, rhs: MyClass) -> Bool { return ObjectIdentifier(lhs) == ObjectIdentifier(rhs) } ...as opposed to just doing this: public static func ==(lhs: MyClass, rhs: MyClass)