static func == (lhs: Self, rhs: Self) -> Bool } protocol Comparable: Equatable { static func < (lhs: Self, rhs: Self) -> Bool } struct AStruct { var p: Int } extension AStruct: Equatable { static func == (lhs: AStruct, rhs: AStruct) -> Bool { return lhs.p == rhs.p } } extension AStruct: Comparable { static func < (lhs: AStruct, rhs: AStruct) -> Bool { return lhs.p < rhs.p } } let a = AStruct(p: 1) let b = AStruct(p: 2) a < b // true