Skip to content

Commit d5b131a

Browse files
committed
Add Comparable conformance to WordPair
1 parent 8f7e71a commit d5b131a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

stdlib/public/Synchronization/Atomics/WordPair.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,18 @@ extension WordPair: Hashable {
183183
}
184184
}
185185

186+
@available(SwiftStdlib 6.2, *)
187+
extension WordPair: Comparable {
188+
// Note: This function can have a lower availability than the conformance
189+
// itself because it's always emit into client.
190+
@available(SwiftStdlib 6.0, *)
191+
@_alwaysEmitIntoClient
192+
@_transparent
193+
public func <(lhs: WordPair, rhs: WordPair) -> Bool {
194+
lhs.first < rhs.first || lhs.second < rhs.second
195+
}
196+
}
197+
186198
@available(SwiftStdlib 6.0, *)
187199
@_unavailableInEmbedded
188200
extension WordPair: CustomStringConvertible {

0 commit comments

Comments
 (0)