@@ -347,6 +347,85 @@ namespace ranges
347
347
template <typename Enable>
348
348
constexpr bool _is_integer_like_<diffmax_t , Enable> = true ;
349
349
#endif
350
+
351
+ template <bool = true >
352
+ struct diffmax_numeric_limits
353
+ {
354
+ static constexpr bool const is_specialized = true ;
355
+ static constexpr bool const is_signed = true ;
356
+ static constexpr bool const is_integer = true ;
357
+ static constexpr bool const is_exact = true ;
358
+ static constexpr bool const has_infinity = false ;
359
+ static constexpr bool const has_quiet_NaN = false ;
360
+ static constexpr bool const has_signaling_NaN = false ;
361
+ static constexpr bool const has_denorm = false ;
362
+ static constexpr bool const has_denorm_loss = false ;
363
+ static constexpr std::float_round_style const round_style =
364
+ std::round_toward_zero;
365
+ static constexpr bool const is_iec559 = false ;
366
+ static constexpr bool const is_bounded = true ;
367
+ static constexpr bool const is_modulo = false ;
368
+ static constexpr int const digits = CHAR_BIT * sizeof (std::uintmax_t ) + 1 ;
369
+ static constexpr int const digits10 =
370
+ static_cast <int >(digits * 0.301029996 ); // digits * std::log10(2)
371
+ static constexpr int const max_digits10 = 0 ;
372
+ static constexpr int const radix = 2 ;
373
+ static constexpr int const min_exponent = 0 ;
374
+ static constexpr int const min_exponent10 = 0 ;
375
+ static constexpr int const max_exponent = 0 ;
376
+ static constexpr int const max_exponent10 = 0 ;
377
+ static constexpr bool const traps = true ;
378
+ static constexpr bool const tinyness_before = false ;
379
+ };
380
+
381
+ #if RANGES_CXX_INLINE_VARIABLES < RANGES_CXX_INLINE_VARIABLES_17
382
+ template <bool B>
383
+ constexpr bool const diffmax_numeric_limits<B>::is_specialized;
384
+ template <bool B>
385
+ constexpr bool const diffmax_numeric_limits<B>::is_signed;
386
+ template <bool B>
387
+ constexpr bool const diffmax_numeric_limits<B>::is_integer;
388
+ template <bool B>
389
+ constexpr bool const diffmax_numeric_limits<B>::is_exact;
390
+ template <bool B>
391
+ constexpr bool const diffmax_numeric_limits<B>::has_infinity;
392
+ template <bool B>
393
+ constexpr bool const diffmax_numeric_limits<B>::has_quiet_NaN;
394
+ template <bool B>
395
+ constexpr bool const diffmax_numeric_limits<B>::has_signaling_NaN;
396
+ template <bool B>
397
+ constexpr bool const diffmax_numeric_limits<B>::has_denorm;
398
+ template <bool B>
399
+ constexpr bool const diffmax_numeric_limits<B>::has_denorm_loss;
400
+ template <bool B>
401
+ constexpr std::float_round_style const diffmax_numeric_limits<B>::round_style;
402
+ template <bool B>
403
+ constexpr bool const diffmax_numeric_limits<B>::is_iec559;
404
+ template <bool B>
405
+ constexpr bool const diffmax_numeric_limits<B>::is_bounded;
406
+ template <bool B>
407
+ constexpr bool const diffmax_numeric_limits<B>::is_modulo;
408
+ template <bool B>
409
+ constexpr int const diffmax_numeric_limits<B>::digits;
410
+ template <bool B>
411
+ constexpr int const diffmax_numeric_limits<B>::digits10;
412
+ template <bool B>
413
+ constexpr int const diffmax_numeric_limits<B>::max_digits10;
414
+ template <bool B>
415
+ constexpr int const diffmax_numeric_limits<B>::radix;
416
+ template <bool B>
417
+ constexpr int const diffmax_numeric_limits<B>::min_exponent;
418
+ template <bool B>
419
+ constexpr int const diffmax_numeric_limits<B>::min_exponent10;
420
+ template <bool B>
421
+ constexpr int const diffmax_numeric_limits<B>::max_exponent;
422
+ template <bool B>
423
+ constexpr int const diffmax_numeric_limits<B>::max_exponent10;
424
+ template <bool B>
425
+ constexpr bool const diffmax_numeric_limits<B>::traps;
426
+ template <bool B>
427
+ constexpr bool const diffmax_numeric_limits<B>::tinyness_before;
428
+ #endif
350
429
} // namespace detail
351
430
// / \endcond
352
431
} // namespace ranges
@@ -358,32 +437,8 @@ namespace std
358
437
{
359
438
template <>
360
439
struct numeric_limits <::ranges::detail::diffmax_t >
440
+ : ::ranges::detail::diffmax_numeric_limits<>
361
441
{
362
- static constexpr bool is_specialized = true ;
363
- static constexpr bool is_signed = true ;
364
- static constexpr bool is_integer = true ;
365
- static constexpr bool is_exact = true ;
366
- static constexpr bool has_infinity = false ;
367
- static constexpr bool has_quiet_NaN = false ;
368
- static constexpr bool has_signaling_NaN = false ;
369
- static constexpr bool has_denorm = false ;
370
- static constexpr bool has_denorm_loss = false ;
371
- static constexpr std::float_round_style round_style = std::round_toward_zero;
372
- static constexpr bool is_iec559 = false ;
373
- static constexpr bool is_bounded = true ;
374
- static constexpr bool is_modulo = false ;
375
- static constexpr int digits = CHAR_BIT * sizeof (std::uintmax_t ) + 1 ;
376
- static constexpr int digits10 =
377
- static_cast <int >(digits * 0.301029996 ); // digits * std::log10(2)
378
- static constexpr int max_digits10 = 0 ;
379
- static constexpr int radix = 2 ;
380
- static constexpr int min_exponent = 0 ;
381
- static constexpr int min_exponent10 = 0 ;
382
- static constexpr int max_exponent = 0 ;
383
- static constexpr int max_exponent10 = 0 ;
384
- static constexpr bool traps = true ;
385
- static constexpr bool tinyness_before = false ;
386
-
387
442
static constexpr ::ranges::detail::diffmax_t max () noexcept
388
443
{
389
444
return std::uintmax_t (-1 );
@@ -421,45 +476,21 @@ namespace std
421
476
return 0 ;
422
477
}
423
478
};
479
+
424
480
template <>
425
481
struct numeric_limits <::ranges::detail::diffmax_t const >
426
482
: numeric_limits<::ranges::detail::diffmax_t >
427
483
{};
484
+
428
485
template <>
429
486
struct numeric_limits <::ranges::detail::diffmax_t volatile >
430
487
: numeric_limits<::ranges::detail::diffmax_t >
431
488
{};
489
+
432
490
template <>
433
491
struct numeric_limits <::ranges::detail::diffmax_t const volatile >
434
492
: numeric_limits<::ranges::detail::diffmax_t >
435
493
{};
436
-
437
- #if RANGES_CXX_INLINE_VARIABLES >= RANGES_CXX_INLINE_VARIABLES_17
438
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::is_specialized;
439
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::is_signed;
440
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::is_integer;
441
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::is_exact;
442
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::has_infinity;
443
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::has_quiet_NaN;
444
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::has_signaling_NaN;
445
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::has_denorm;
446
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::has_denorm_loss;
447
- inline constexpr std::float_round_style
448
- numeric_limits<::ranges::detail::diffmax_t >::round_style;
449
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::is_iec559;
450
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::is_bounded;
451
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::is_modulo;
452
- inline constexpr int numeric_limits<::ranges::detail::diffmax_t >::digits;
453
- inline constexpr int numeric_limits<::ranges::detail::diffmax_t >::digits10;
454
- inline constexpr int numeric_limits<::ranges::detail::diffmax_t >::max_digits10;
455
- inline constexpr int numeric_limits<::ranges::detail::diffmax_t >::radix;
456
- inline constexpr int numeric_limits<::ranges::detail::diffmax_t >::min_exponent;
457
- inline constexpr int numeric_limits<::ranges::detail::diffmax_t >::min_exponent10;
458
- inline constexpr int numeric_limits<::ranges::detail::diffmax_t >::max_exponent;
459
- inline constexpr int numeric_limits<::ranges::detail::diffmax_t >::max_exponent10;
460
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::traps;
461
- inline constexpr bool numeric_limits<::ranges::detail::diffmax_t >::tinyness_before;
462
- #endif
463
494
} // namespace std
464
495
// / \endcond
465
496
0 commit comments