@@ -51,13 +51,14 @@ public struct MinimalEquatableValue : Equatable {
51
51
self . value = value
52
52
self . identity = identity
53
53
}
54
- }
55
- public func == (
56
- lhs: MinimalEquatableValue ,
57
- rhs: MinimalEquatableValue
58
- ) -> Bool {
59
- MinimalEquatableValue . timesEqualEqualWasCalled += 1
60
- return MinimalEquatableValue . equalImpl. value ( lhs. value, rhs. value)
54
+
55
+ public static func == (
56
+ lhs: MinimalEquatableValue ,
57
+ rhs: MinimalEquatableValue
58
+ ) -> Bool {
59
+ MinimalEquatableValue . timesEqualEqualWasCalled += 1
60
+ return MinimalEquatableValue . equalImpl. value ( lhs. value, rhs. value)
61
+ }
61
62
}
62
63
63
64
/// A type that conforms only to `Equatable` and `Comparable`.
@@ -85,22 +86,22 @@ public struct MinimalComparableValue : Equatable, Comparable {
85
86
self . value = value
86
87
self . identity = identity
87
88
}
88
- }
89
89
90
- public func == (
91
- lhs: MinimalComparableValue ,
92
- rhs: MinimalComparableValue
93
- ) -> Bool {
94
- MinimalComparableValue . timesEqualEqualWasCalled. value += 1
95
- return MinimalComparableValue . equalImpl. value ( lhs. value, rhs. value)
96
- }
90
+ public static func == (
91
+ lhs: MinimalComparableValue ,
92
+ rhs: MinimalComparableValue
93
+ ) -> Bool {
94
+ MinimalComparableValue . timesEqualEqualWasCalled. value += 1
95
+ return MinimalComparableValue . equalImpl. value ( lhs. value, rhs. value)
96
+ }
97
97
98
- public func < (
99
- lhs: MinimalComparableValue ,
100
- rhs: MinimalComparableValue
101
- ) -> Bool {
102
- MinimalComparableValue . timesLessWasCalled. value += 1
103
- return MinimalComparableValue . lessImpl. value ( lhs. value, rhs. value)
98
+ public static func < (
99
+ lhs: MinimalComparableValue ,
100
+ rhs: MinimalComparableValue
101
+ ) -> Bool {
102
+ MinimalComparableValue . timesLessWasCalled. value += 1
103
+ return MinimalComparableValue . lessImpl. value ( lhs. value, rhs. value)
104
+ }
104
105
}
105
106
106
107
@@ -130,19 +131,20 @@ public struct MinimalHashableValue : Equatable, Hashable {
130
131
self . identity = identity
131
132
}
132
133
134
+ public static func == (
135
+ lhs: MinimalHashableValue ,
136
+ rhs: MinimalHashableValue
137
+ ) -> Bool {
138
+ MinimalHashableValue . timesEqualEqualWasCalled += 1
139
+ return MinimalHashableValue . equalImpl. value ( lhs. value, rhs. value)
140
+ }
141
+
133
142
public var hashValue : Int {
134
143
MinimalHashableValue . timesHashValueWasCalled += 1
135
144
return MinimalHashableValue . hashValueImpl. value ( value)
136
145
}
137
146
}
138
147
139
- public func == (
140
- lhs: MinimalHashableValue ,
141
- rhs: MinimalHashableValue
142
- ) -> Bool {
143
- MinimalHashableValue . timesEqualEqualWasCalled += 1
144
- return MinimalHashableValue . equalImpl. value ( lhs. value, rhs. value)
145
- }
146
148
147
149
148
150
/// A type that conforms only to `Equatable` and `Hashable`.
@@ -171,29 +173,34 @@ public class MinimalHashableClass : Equatable, Hashable {
171
173
self . identity = identity
172
174
}
173
175
176
+ public static func == (
177
+ lhs: MinimalHashableClass ,
178
+ rhs: MinimalHashableClass
179
+ ) -> Bool {
180
+ MinimalHashableClass . timesEqualEqualWasCalled += 1
181
+ return MinimalHashableClass . equalImpl. value ( lhs. value, rhs. value)
182
+ }
183
+
174
184
public var hashValue : Int {
175
185
MinimalHashableClass . timesHashValueWasCalled += 1
176
186
return MinimalHashableClass . hashValueImpl. value ( value)
177
187
}
178
188
}
179
189
180
- public func == (
181
- lhs: MinimalHashableClass ,
182
- rhs: MinimalHashableClass
183
- ) -> Bool {
184
- MinimalHashableClass . timesEqualEqualWasCalled += 1
185
- return MinimalHashableClass . equalImpl. value ( lhs. value, rhs. value)
186
- }
187
190
188
191
189
192
190
193
public var GenericMinimalHashableValue_timesEqualEqualWasCalled : Int = 0
191
194
public var GenericMinimalHashableValue_timesHashValueWasCalled : Int = 0
192
195
193
- public var GenericMinimalHashableValue_equalImpl = ResettableValue < ( Any , Any ) -> Bool > (
194
- { _, _ in fatalError ( " GenericMinimalHashableValue_equalImpl is not set yet " ) ; ( ) } )
195
- public var GenericMinimalHashableValue_hashValueImpl = ResettableValue < ( Any ) -> Int > (
196
- { _ in fatalError ( " GenericMinimalHashableValue_hashValueImpl is not set yet " ) ; ( ) } )
196
+ public var GenericMinimalHashableValue_equalImpl =
197
+ ResettableValue < ( Any , Any ) -> Bool > ( { _, _ in
198
+ fatalError ( " GenericMinimalHashableValue_equalImpl is not set yet " )
199
+ } )
200
+ public var GenericMinimalHashableValue_hashValueImpl =
201
+ ResettableValue < ( Any ) -> Int > ( { _ in
202
+ fatalError ( " GenericMinimalHashableValue_hashValueImpl is not set yet " )
203
+ } )
197
204
198
205
/// A type that conforms only to `Equatable` and `Hashable`.
199
206
///
@@ -213,28 +220,32 @@ public struct GenericMinimalHashableValue<Wrapped> : Equatable, Hashable {
213
220
self . identity = identity
214
221
}
215
222
223
+ public static func == < Wrapped> (
224
+ lhs: GenericMinimalHashableValue < Wrapped > ,
225
+ rhs: GenericMinimalHashableValue < Wrapped >
226
+ ) -> Bool {
227
+ GenericMinimalHashableValue_timesEqualEqualWasCalled += 1
228
+ return GenericMinimalHashableValue_equalImpl . value ( lhs. value, rhs. value)
229
+ }
230
+
216
231
public var hashValue : Int {
217
232
GenericMinimalHashableValue_timesHashValueWasCalled += 1
218
233
return GenericMinimalHashableValue_hashValueImpl . value ( value)
219
234
}
220
235
}
221
236
222
- public func == < Wrapped> (
223
- lhs: GenericMinimalHashableValue < Wrapped > ,
224
- rhs: GenericMinimalHashableValue < Wrapped >
225
- ) -> Bool {
226
- GenericMinimalHashableValue_timesEqualEqualWasCalled += 1
227
- return GenericMinimalHashableValue_equalImpl . value ( lhs. value, rhs. value)
228
- }
229
-
230
237
231
238
public var GenericMinimalHashableClass_timesEqualEqualWasCalled : Int = 0
232
239
public var GenericMinimalHashableClass_timesHashValueWasCalled : Int = 0
233
240
234
- public var GenericMinimalHashableClass_equalImpl = ResettableValue < ( Any , Any ) -> Bool > (
235
- { _, _ in fatalError ( " GenericMinimalHashableClass_equalImpl is not set yet " ) ; ( ) } )
236
- public var GenericMinimalHashableClass_hashValueImpl = ResettableValue < ( Any ) -> Int > (
237
- { _ in fatalError ( " GenericMinimalHashableClass_hashValueImpl is not set yet " ) ; ( ) } )
241
+ public var GenericMinimalHashableClass_equalImpl =
242
+ ResettableValue < ( Any , Any ) -> Bool > ( { _, _ in
243
+ fatalError ( " GenericMinimalHashableClass_equalImpl is not set yet " )
244
+ } )
245
+ public var GenericMinimalHashableClass_hashValueImpl =
246
+ ResettableValue < ( Any ) -> Int > ( { _ in
247
+ fatalError ( " GenericMinimalHashableClass_hashValueImpl is not set yet " )
248
+ } )
238
249
239
250
/// A type that conforms only to `Equatable` and `Hashable`.
240
251
///
@@ -254,19 +265,20 @@ public class GenericMinimalHashableClass<Wrapped> : Equatable, Hashable {
254
265
self . identity = identity
255
266
}
256
267
268
+ public static func == < Wrapped> (
269
+ lhs: GenericMinimalHashableClass < Wrapped > ,
270
+ rhs: GenericMinimalHashableClass < Wrapped >
271
+ ) -> Bool {
272
+ GenericMinimalHashableClass_timesEqualEqualWasCalled += 1
273
+ return GenericMinimalHashableClass_equalImpl . value ( lhs. value, rhs. value)
274
+ }
275
+
257
276
public var hashValue : Int {
258
277
GenericMinimalHashableClass_timesHashValueWasCalled += 1
259
278
return GenericMinimalHashableClass_hashValueImpl . value ( value)
260
279
}
261
280
}
262
281
263
- public func == < Wrapped> (
264
- lhs: GenericMinimalHashableClass < Wrapped > ,
265
- rhs: GenericMinimalHashableClass < Wrapped >
266
- ) -> Bool {
267
- GenericMinimalHashableClass_timesEqualEqualWasCalled += 1
268
- return GenericMinimalHashableClass_equalImpl . value ( lhs. value, rhs. value)
269
- }
270
282
271
283
272
284
/// A type that conforms only to `Equatable`, `Comparable`, and `Strideable`.
@@ -299,6 +311,22 @@ public struct MinimalStrideableValue : Equatable, Comparable, Strideable {
299
311
300
312
public typealias Stride = Int
301
313
314
+ public static func == (
315
+ lhs: MinimalStrideableValue ,
316
+ rhs: MinimalStrideableValue
317
+ ) -> Bool {
318
+ MinimalStrideableValue . timesEqualEqualWasCalled. value += 1
319
+ return MinimalStrideableValue . equalImpl. value ( lhs. value, rhs. value)
320
+ }
321
+
322
+ public static func < (
323
+ lhs: MinimalStrideableValue ,
324
+ rhs: MinimalStrideableValue
325
+ ) -> Bool {
326
+ MinimalStrideableValue . timesLessWasCalled. value += 1
327
+ return MinimalStrideableValue . lessImpl. value ( lhs. value, rhs. value)
328
+ }
329
+
302
330
public func distance( to other: MinimalStrideableValue ) -> Stride {
303
331
MinimalStrideableValue . timesDistanceWasCalled. value += 1
304
332
return other. value - self . value
@@ -310,21 +338,6 @@ public struct MinimalStrideableValue : Equatable, Comparable, Strideable {
310
338
}
311
339
}
312
340
313
- public func == (
314
- lhs: MinimalStrideableValue ,
315
- rhs: MinimalStrideableValue
316
- ) -> Bool {
317
- MinimalStrideableValue . timesEqualEqualWasCalled. value += 1
318
- return MinimalStrideableValue . equalImpl. value ( lhs. value, rhs. value)
319
- }
320
-
321
- public func < (
322
- lhs: MinimalStrideableValue ,
323
- rhs: MinimalStrideableValue
324
- ) -> Bool {
325
- MinimalStrideableValue . timesLessWasCalled. value += 1
326
- return MinimalStrideableValue . lessImpl. value ( lhs. value, rhs. value)
327
- }
328
341
329
342
// Local Variables:
330
343
// eval: (read-only-mode 1)
0 commit comments