@@ -129,8 +129,7 @@ namespace std {
129
129
130
130
_LIBCPP_BEGIN_NAMESPACE_STD
131
131
132
- #if _LIBCPP_STD_VER > 17
133
-
132
+ #if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
134
133
// exposition only
135
134
enum class _LIBCPP_ENUM_VIS _EqResult : unsigned char {
136
135
__zero = 0 ,
@@ -184,24 +183,19 @@ public:
184
183
185
184
// comparisons
186
185
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator ==(partial_ordering __v, _CmpUnspecifiedParam) noexcept ;
187
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator !=(partial_ordering __v, _CmpUnspecifiedParam) noexcept ;
188
186
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator < (partial_ordering __v, _CmpUnspecifiedParam) noexcept ;
189
187
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator <=(partial_ordering __v, _CmpUnspecifiedParam) noexcept ;
190
188
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator > (partial_ordering __v, _CmpUnspecifiedParam) noexcept ;
191
189
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator >=(partial_ordering __v, _CmpUnspecifiedParam) noexcept ;
192
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator ==(_CmpUnspecifiedParam, partial_ordering __v) noexcept ;
193
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator !=(_CmpUnspecifiedParam, partial_ordering __v) noexcept ;
194
190
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator < (_CmpUnspecifiedParam, partial_ordering __v) noexcept ;
195
191
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator <=(_CmpUnspecifiedParam, partial_ordering __v) noexcept ;
196
192
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator > (_CmpUnspecifiedParam, partial_ordering __v) noexcept ;
197
193
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator >=(_CmpUnspecifiedParam, partial_ordering __v) noexcept ;
198
194
199
- #ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
200
195
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator ==(partial_ordering, partial_ordering) noexcept = default ;
201
196
202
197
_LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator <=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept ;
203
198
_LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator <=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept ;
204
- #endif
205
199
206
200
private:
207
201
_ValueT __value_;
@@ -233,10 +227,6 @@ constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
233
227
return __v.__is_ordered () && __v.__value_ >= 0 ;
234
228
}
235
229
236
- _LIBCPP_INLINE_VISIBILITY
237
- constexpr bool operator ==(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
238
- return __v.__is_ordered () && 0 == __v.__value_ ;
239
- }
240
230
_LIBCPP_INLINE_VISIBILITY
241
231
constexpr bool operator < (_CmpUnspecifiedParam, partial_ordering __v) noexcept {
242
232
return __v.__is_ordered () && 0 < __v.__value_ ;
@@ -254,16 +244,6 @@ constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
254
244
return __v.__is_ordered () && 0 >= __v.__value_ ;
255
245
}
256
246
257
- _LIBCPP_INLINE_VISIBILITY
258
- constexpr bool operator !=(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
259
- return !__v.__is_ordered () || __v.__value_ != 0 ;
260
- }
261
- _LIBCPP_INLINE_VISIBILITY
262
- constexpr bool operator !=(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
263
- return !__v.__is_ordered () || __v.__value_ != 0 ;
264
- }
265
-
266
- #ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
267
247
_LIBCPP_INLINE_VISIBILITY
268
248
constexpr partial_ordering operator <=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept {
269
249
return __v;
@@ -272,7 +252,6 @@ _LIBCPP_INLINE_VISIBILITY
272
252
constexpr partial_ordering operator <=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept {
273
253
return __v < 0 ? partial_ordering::greater : (__v > 0 ? partial_ordering::less : __v);
274
254
}
275
- #endif // _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
276
255
277
256
class weak_ordering {
278
257
using _ValueT = signed char ;
@@ -295,24 +274,19 @@ public:
295
274
296
275
// comparisons
297
276
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator ==(weak_ordering __v, _CmpUnspecifiedParam) noexcept ;
298
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator !=(weak_ordering __v, _CmpUnspecifiedParam) noexcept ;
299
277
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator < (weak_ordering __v, _CmpUnspecifiedParam) noexcept ;
300
278
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator <=(weak_ordering __v, _CmpUnspecifiedParam) noexcept ;
301
279
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator > (weak_ordering __v, _CmpUnspecifiedParam) noexcept ;
302
280
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator >=(weak_ordering __v, _CmpUnspecifiedParam) noexcept ;
303
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator ==(_CmpUnspecifiedParam, weak_ordering __v) noexcept ;
304
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator !=(_CmpUnspecifiedParam, weak_ordering __v) noexcept ;
305
281
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator < (_CmpUnspecifiedParam, weak_ordering __v) noexcept ;
306
282
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator <=(_CmpUnspecifiedParam, weak_ordering __v) noexcept ;
307
283
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator > (_CmpUnspecifiedParam, weak_ordering __v) noexcept ;
308
284
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator >=(_CmpUnspecifiedParam, weak_ordering __v) noexcept ;
309
285
310
- #ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
311
286
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator ==(weak_ordering, weak_ordering) noexcept = default ;
312
287
313
288
_LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator <=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept ;
314
289
_LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator <=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept ;
315
- #endif
316
290
317
291
private:
318
292
_ValueT __value_;
@@ -327,10 +301,6 @@ constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
327
301
return __v.__value_ == 0 ;
328
302
}
329
303
_LIBCPP_INLINE_VISIBILITY
330
- constexpr bool operator !=(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
331
- return __v.__value_ != 0 ;
332
- }
333
- _LIBCPP_INLINE_VISIBILITY
334
304
constexpr bool operator < (weak_ordering __v, _CmpUnspecifiedParam) noexcept {
335
305
return __v.__value_ < 0 ;
336
306
}
@@ -347,14 +317,6 @@ constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
347
317
return __v.__value_ >= 0 ;
348
318
}
349
319
_LIBCPP_INLINE_VISIBILITY
350
- constexpr bool operator ==(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
351
- return 0 == __v.__value_ ;
352
- }
353
- _LIBCPP_INLINE_VISIBILITY
354
- constexpr bool operator !=(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
355
- return 0 != __v.__value_ ;
356
- }
357
- _LIBCPP_INLINE_VISIBILITY
358
320
constexpr bool operator < (_CmpUnspecifiedParam, weak_ordering __v) noexcept {
359
321
return 0 < __v.__value_ ;
360
322
}
@@ -371,7 +333,6 @@ constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
371
333
return 0 >= __v.__value_ ;
372
334
}
373
335
374
- #ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
375
336
_LIBCPP_INLINE_VISIBILITY
376
337
constexpr weak_ordering operator <=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept {
377
338
return __v;
@@ -380,8 +341,6 @@ _LIBCPP_INLINE_VISIBILITY
380
341
constexpr weak_ordering operator <=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept {
381
342
return __v < 0 ? weak_ordering::greater : (__v > 0 ? weak_ordering::less : __v);
382
343
}
383
- #endif // _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
384
-
385
344
class strong_ordering {
386
345
using _ValueT = signed char ;
387
346
@@ -411,24 +370,19 @@ public:
411
370
412
371
// comparisons
413
372
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator ==(strong_ordering __v, _CmpUnspecifiedParam) noexcept ;
414
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator !=(strong_ordering __v, _CmpUnspecifiedParam) noexcept ;
415
373
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator < (strong_ordering __v, _CmpUnspecifiedParam) noexcept ;
416
374
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator <=(strong_ordering __v, _CmpUnspecifiedParam) noexcept ;
417
375
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator > (strong_ordering __v, _CmpUnspecifiedParam) noexcept ;
418
376
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator >=(strong_ordering __v, _CmpUnspecifiedParam) noexcept ;
419
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator ==(_CmpUnspecifiedParam, strong_ordering __v) noexcept ;
420
- _LIBCPP_INLINE_VISIBILITY friend constexpr bool operator !=(_CmpUnspecifiedParam, strong_ordering __v) noexcept ;
421
377
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator < (_CmpUnspecifiedParam, strong_ordering __v) noexcept ;
422
378
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator <=(_CmpUnspecifiedParam, strong_ordering __v) noexcept ;
423
379
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator > (_CmpUnspecifiedParam, strong_ordering __v) noexcept ;
424
380
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator >=(_CmpUnspecifiedParam, strong_ordering __v) noexcept ;
425
381
426
- #ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
427
382
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator ==(strong_ordering, strong_ordering) noexcept = default ;
428
383
429
384
_LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator <=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept ;
430
385
_LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator <=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept ;
431
- #endif
432
386
433
387
private:
434
388
_ValueT __value_;
@@ -444,10 +398,6 @@ constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
444
398
return __v.__value_ == 0 ;
445
399
}
446
400
_LIBCPP_INLINE_VISIBILITY
447
- constexpr bool operator !=(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
448
- return __v.__value_ != 0 ;
449
- }
450
- _LIBCPP_INLINE_VISIBILITY
451
401
constexpr bool operator < (strong_ordering __v, _CmpUnspecifiedParam) noexcept {
452
402
return __v.__value_ < 0 ;
453
403
}
@@ -464,14 +414,6 @@ constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
464
414
return __v.__value_ >= 0 ;
465
415
}
466
416
_LIBCPP_INLINE_VISIBILITY
467
- constexpr bool operator ==(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
468
- return 0 == __v.__value_ ;
469
- }
470
- _LIBCPP_INLINE_VISIBILITY
471
- constexpr bool operator !=(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
472
- return 0 != __v.__value_ ;
473
- }
474
- _LIBCPP_INLINE_VISIBILITY
475
417
constexpr bool operator < (_CmpUnspecifiedParam, strong_ordering __v) noexcept {
476
418
return 0 < __v.__value_ ;
477
419
}
@@ -488,7 +430,6 @@ constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
488
430
return 0 >= __v.__value_ ;
489
431
}
490
432
491
- #ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
492
433
_LIBCPP_INLINE_VISIBILITY
493
434
constexpr strong_ordering operator <=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept {
494
435
return __v;
@@ -497,7 +438,6 @@ _LIBCPP_INLINE_VISIBILITY
497
438
constexpr strong_ordering operator <=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept {
498
439
return __v < 0 ? strong_ordering::greater : (__v > 0 ? strong_ordering::less : __v);
499
440
}
500
- #endif // _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
501
441
502
442
// named comparison functions
503
443
_LIBCPP_INLINE_VISIBILITY
@@ -582,7 +522,7 @@ template<class _Tp> constexpr strong_ordering strong_order(const _Tp& __lhs, con
582
522
template <class _Tp > constexpr weak_ordering weak_order (const _Tp& __lhs, const _Tp& __rhs);
583
523
template <class _Tp > constexpr partial_ordering partial_order (const _Tp& __lhs, const _Tp& __rhs);
584
524
585
- #endif // _LIBCPP_STD_VER > 17
525
+ #endif // _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_SPACESHIP_OPERATOR)
586
526
587
527
_LIBCPP_END_NAMESPACE_STD
588
528
0 commit comments