We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba585fd commit 9786d11Copy full SHA for 9786d11
stdlib/public/Cxx/std/String.swift
@@ -161,6 +161,26 @@ extension std.u32string: Equatable {
161
}
162
163
164
+// MARK: Comparable conformance for C++ strings
165
+
166
+extension std.string: Comparable {
167
+ public static func <(lhs: std.string, rhs: std.string) -> Bool {
168
+ return lhs.compare(rhs) < 0
169
+ }
170
+}
171
172
+extension std.u16string: Comparable {
173
+ public static func <(lhs: std.u16string, rhs: std.u16string) -> Bool {
174
175
176
177
178
+extension std.u32string: Comparable {
179
+ public static func <(lhs: std.u32string, rhs: std.u32string) -> Bool {
180
181
182
183
184
// MARK: Hashing C++ strings
185
186
extension std.string: Hashable {
0 commit comments