- tmp/tmp6ubnj0dh/{from.md → to.md} +112 -84
tmp/tmp6ubnj0dh/{from.md → to.md}
RENAMED
|
@@ -13,70 +13,94 @@ about the C++ standard library (e.g., version number and release date).
|
|
| 13 |
|
| 14 |
Each of the macros defined in `<version>` is also defined after
|
| 15 |
inclusion of any member of the set of library headers indicated in the
|
| 16 |
corresponding comment in this synopsis.
|
| 17 |
|
| 18 |
-
[*Note 1*: Future
|
| 19 |
-
|
| 20 |
|
| 21 |
``` cpp
|
| 22 |
#define __cpp_lib_addressof_constexpr 201603L // also in <memory>
|
|
|
|
|
|
|
|
|
|
| 23 |
#define __cpp_lib_allocator_traits_is_always_equal 201411L
|
| 24 |
// also in <memory>, <scoped_allocator>, <string>, <deque>, <forward_list>, <list>, <vector>,
|
| 25 |
// <map>, <set>, <unordered_map>, <unordered_set>
|
|
|
|
| 26 |
#define __cpp_lib_any 201606L // also in <any>
|
| 27 |
#define __cpp_lib_apply 201603L // also in <tuple>
|
| 28 |
#define __cpp_lib_array_constexpr 201811L // also in <iterator>, <array>
|
| 29 |
#define __cpp_lib_as_const 201510L // also in <utility>
|
|
|
|
|
|
|
| 30 |
#define __cpp_lib_assume_aligned 201811L // also in <memory>
|
| 31 |
#define __cpp_lib_atomic_flag_test 201907L // also in <atomic>
|
| 32 |
#define __cpp_lib_atomic_float 201711L // also in <atomic>
|
| 33 |
#define __cpp_lib_atomic_is_always_lock_free 201603L // also in <atomic>
|
| 34 |
#define __cpp_lib_atomic_lock_free_type_aliases 201907L // also in <atomic>
|
| 35 |
#define __cpp_lib_atomic_ref 201806L // also in <atomic>
|
| 36 |
#define __cpp_lib_atomic_shared_ptr 201711L // also in <memory>
|
| 37 |
#define __cpp_lib_atomic_value_initialization 201911L // also in <atomic>, <memory>
|
| 38 |
#define __cpp_lib_atomic_wait 201907L // also in <atomic>
|
| 39 |
-
#define __cpp_lib_barrier
|
|
|
|
| 40 |
#define __cpp_lib_bind_front 201907L // also in <functional>
|
| 41 |
#define __cpp_lib_bit_cast 201806L // also in <bit>
|
| 42 |
#define __cpp_lib_bitops 201907L // also in <bit>
|
| 43 |
#define __cpp_lib_bool_constant 201505L // also in <type_traits>
|
| 44 |
#define __cpp_lib_bounded_array_traits 201902L // also in <type_traits>
|
| 45 |
#define __cpp_lib_boyer_moore_searcher 201603L // also in <functional>
|
| 46 |
#define __cpp_lib_byte 201603L // also in <cstddef>
|
|
|
|
| 47 |
#define __cpp_lib_char8_t 201907L
|
| 48 |
// also in <atomic>, <filesystem>, <istream>, <limits>, <locale>, <ostream>, <string>, <string_view>
|
| 49 |
#define __cpp_lib_chrono 201907L // also in <chrono>
|
| 50 |
#define __cpp_lib_chrono_udls 201304L // also in <chrono>
|
| 51 |
#define __cpp_lib_clamp 201603L // also in <algorithm>
|
|
|
|
|
|
|
| 52 |
#define __cpp_lib_complex_udls 201309L // also in <complex>
|
| 53 |
-
#define __cpp_lib_concepts
|
| 54 |
-
#define __cpp_lib_constexpr_algorithms 201806L // also in <algorithm>
|
|
|
|
|
|
|
|
|
|
| 55 |
#define __cpp_lib_constexpr_complex 201711L // also in <complex>
|
| 56 |
#define __cpp_lib_constexpr_dynamic_alloc 201907L // also in <memory>
|
| 57 |
#define __cpp_lib_constexpr_functional 201907L // also in <functional>
|
| 58 |
#define __cpp_lib_constexpr_iterator 201811L // also in <iterator>
|
| 59 |
-
#define __cpp_lib_constexpr_memory
|
| 60 |
#define __cpp_lib_constexpr_numeric 201911L // also in <numeric>
|
| 61 |
#define __cpp_lib_constexpr_string 201907L // also in <string>
|
| 62 |
#define __cpp_lib_constexpr_string_view 201811L // also in <string_view>
|
| 63 |
#define __cpp_lib_constexpr_tuple 201811L // also in <tuple>
|
|
|
|
| 64 |
#define __cpp_lib_constexpr_utility 201811L // also in <utility>
|
| 65 |
#define __cpp_lib_constexpr_vector 201907L // also in <vector>
|
|
|
|
|
|
|
|
|
|
| 66 |
#define __cpp_lib_coroutine 201902L // also in <coroutine>
|
| 67 |
#define __cpp_lib_destroying_delete 201806L // also in <new>
|
| 68 |
#define __cpp_lib_enable_shared_from_this 201603L // also in <memory>
|
| 69 |
#define __cpp_lib_endian 201907L // also in <bit>
|
| 70 |
#define __cpp_lib_erase_if 202002L
|
| 71 |
// also in <string>, <deque>, <forward_list>, <list>, <vector>, <map>, <set>, <unordered_map>,
|
| 72 |
// <unordered_set>
|
| 73 |
#define __cpp_lib_exchange_function 201304L // also in <utility>
|
| 74 |
#define __cpp_lib_execution 201902L // also in <execution>
|
|
|
|
| 75 |
#define __cpp_lib_filesystem 201703L // also in <filesystem>
|
| 76 |
-
#define
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
#define __cpp_lib_gcd_lcm 201606L // also in <numeric>
|
|
|
|
| 78 |
#define __cpp_lib_generic_associative_lookup 201304L // also in <map>, <set>
|
| 79 |
#define __cpp_lib_generic_unordered_lookup 201811L
|
| 80 |
// also in <unordered_map>, <unordered_set>
|
| 81 |
#define __cpp_lib_hardware_interference_size 201703L // also in <new>
|
| 82 |
#define __cpp_lib_has_unique_object_representations 201606L // also in <type_traits>
|
|
@@ -87,18 +111,22 @@ the values of these macros with greater values. — *end note*]
|
|
| 87 |
#define __cpp_lib_integer_comparison_functions 202002L // also in <utility>
|
| 88 |
#define __cpp_lib_integer_sequence 201304L // also in <utility>
|
| 89 |
#define __cpp_lib_integral_constant_callable 201304L // also in <type_traits>
|
| 90 |
#define __cpp_lib_interpolate 201902L // also in <cmath>, <numeric>
|
| 91 |
#define __cpp_lib_invoke 201411L // also in <functional>
|
|
|
|
|
|
|
| 92 |
#define __cpp_lib_is_aggregate 201703L // also in <type_traits>
|
| 93 |
#define __cpp_lib_is_constant_evaluated 201811L // also in <type_traits>
|
| 94 |
#define __cpp_lib_is_final 201402L // also in <type_traits>
|
|
|
|
| 95 |
#define __cpp_lib_is_invocable 201703L // also in <type_traits>
|
| 96 |
#define __cpp_lib_is_layout_compatible 201907L // also in <type_traits>
|
| 97 |
#define __cpp_lib_is_nothrow_convertible 201806L // also in <type_traits>
|
| 98 |
#define __cpp_lib_is_null_pointer 201309L // also in <type_traits>
|
| 99 |
#define __cpp_lib_is_pointer_interconvertible 201907L // also in <type_traits>
|
|
|
|
| 100 |
#define __cpp_lib_is_swappable 201603L // also in <type_traits>
|
| 101 |
#define __cpp_lib_jthread 201911L // also in <stop_token>, <thread>
|
| 102 |
#define __cpp_lib_latch 201907L // also in <latch>
|
| 103 |
#define __cpp_lib_launder 201606L // also in <new>
|
| 104 |
#define __cpp_lib_list_remove_return_type 201806L // also in <forward_list>, <list>
|
|
@@ -107,68 +135,102 @@ the values of these macros with greater values. — *end note*]
|
|
| 107 |
#define __cpp_lib_make_reverse_iterator 201402L // also in <iterator>
|
| 108 |
#define __cpp_lib_make_unique 201304L // also in <memory>
|
| 109 |
#define __cpp_lib_map_try_emplace 201411L // also in <map>
|
| 110 |
#define __cpp_lib_math_constants 201907L // also in <numbers>
|
| 111 |
#define __cpp_lib_math_special_functions 201603L // also in <cmath>
|
|
|
|
| 112 |
#define __cpp_lib_memory_resource 201603L // also in <memory_resource>
|
|
|
|
|
|
|
|
|
|
| 113 |
#define __cpp_lib_node_extract 201606L
|
| 114 |
// also in <map>, <set>, <unordered_map>, <unordered_set>
|
| 115 |
#define __cpp_lib_nonmember_container_access 201411L
|
| 116 |
// also in <array>, <deque>, <forward_list>, <iterator>, <list>, <map>, <regex>, <set>, <string>,
|
| 117 |
// <unordered_map>, <unordered_set>, <vector>
|
| 118 |
#define __cpp_lib_not_fn 201603L // also in <functional>
|
| 119 |
#define __cpp_lib_null_iterators 201304L // also in <iterator>
|
| 120 |
-
#define __cpp_lib_optional
|
|
|
|
| 121 |
#define __cpp_lib_parallel_algorithm 201603L // also in <algorithm>, <numeric>
|
| 122 |
-
#define __cpp_lib_polymorphic_allocator 201902L // also in <
|
|
|
|
| 123 |
#define __cpp_lib_quoted_string_io 201304L // also in <iomanip>
|
| 124 |
-
#define __cpp_lib_ranges
|
| 125 |
// also in <algorithm>, <functional>, <iterator>, <memory>, <ranges>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
#define __cpp_lib_raw_memory_algorithms 201606L // also in <memory>
|
|
|
|
| 127 |
#define __cpp_lib_remove_cvref 201711L // also in <type_traits>
|
| 128 |
#define __cpp_lib_result_of_sfinae 201210L // also in <functional>, <type_traits>
|
| 129 |
#define __cpp_lib_robust_nonmodifying_seq_ops 201304L // also in <algorithm>
|
| 130 |
#define __cpp_lib_sample 201603L // also in <algorithm>
|
| 131 |
#define __cpp_lib_scoped_lock 201703L // also in <mutex>
|
| 132 |
#define __cpp_lib_semaphore 201907L // also in <semaphore>
|
| 133 |
#define __cpp_lib_shared_mutex 201505L // also in <shared_mutex>
|
| 134 |
#define __cpp_lib_shared_ptr_arrays 201707L // also in <memory>
|
| 135 |
#define __cpp_lib_shared_ptr_weak_type 201606L // also in <memory>
|
| 136 |
#define __cpp_lib_shared_timed_mutex 201402L // also in <shared_mutex>
|
| 137 |
-
#define __cpp_lib_shift
|
| 138 |
#define __cpp_lib_smart_ptr_for_overwrite 202002L // also in <memory>
|
| 139 |
#define __cpp_lib_source_location 201907L // also in <source_location>
|
| 140 |
#define __cpp_lib_span 202002L // also in <span>
|
|
|
|
| 141 |
#define __cpp_lib_ssize 201902L // also in <iterator>
|
|
|
|
|
|
|
| 142 |
#define __cpp_lib_starts_ends_with 201711L // also in <string>, <string_view>
|
|
|
|
|
|
|
|
|
|
| 143 |
#define __cpp_lib_string_udls 201304L // also in <string>
|
| 144 |
#define __cpp_lib_string_view 201803L // also in <string>, <string_view>
|
| 145 |
#define __cpp_lib_syncbuf 201803L // also in <syncstream>
|
| 146 |
#define __cpp_lib_three_way_comparison 201907L // also in <compare>
|
| 147 |
#define __cpp_lib_to_address 201711L // also in <memory>
|
| 148 |
#define __cpp_lib_to_array 201907L // also in <array>
|
| 149 |
#define __cpp_lib_to_chars 201611L // also in <charconv>
|
|
|
|
| 150 |
#define __cpp_lib_transformation_trait_aliases 201304L // also in <type_traits>
|
| 151 |
#define __cpp_lib_transparent_operators 201510L // also in <memory>, <functional>
|
|
|
|
|
|
|
| 152 |
#define __cpp_lib_tuple_element_t 201402L // also in <tuple>
|
| 153 |
#define __cpp_lib_tuples_by_type 201304L // also in <utility>, <tuple>
|
| 154 |
#define __cpp_lib_type_identity 201806L // also in <type_traits>
|
| 155 |
#define __cpp_lib_type_trait_variable_templates 201510L // also in <type_traits>
|
| 156 |
#define __cpp_lib_uncaught_exceptions 201411L // also in <exception>
|
| 157 |
#define __cpp_lib_unordered_map_try_emplace 201411L // also in <unordered_map>
|
|
|
|
| 158 |
#define __cpp_lib_unwrap_ref 201811L // also in <type_traits>
|
| 159 |
-
#define __cpp_lib_variant
|
| 160 |
#define __cpp_lib_void_t 201411L // also in <type_traits>
|
| 161 |
```
|
| 162 |
|
| 163 |
### Header `<limits>` synopsis <a id="limits.syn">[[limits.syn]]</a>
|
| 164 |
|
| 165 |
``` cpp
|
|
|
|
| 166 |
namespace std {
|
| 167 |
-
// [
|
| 168 |
enum float_round_style;
|
| 169 |
-
enum float_denorm_style;
|
| 170 |
|
| 171 |
// [numeric.limits], class template numeric_limits
|
| 172 |
template<class T> class numeric_limits;
|
| 173 |
|
| 174 |
template<class T> class numeric_limits<const T>;
|
|
@@ -198,13 +260,11 @@ namespace std {
|
|
| 198 |
template<> class numeric_limits<double>;
|
| 199 |
template<> class numeric_limits<long double>;
|
| 200 |
}
|
| 201 |
```
|
| 202 |
|
| 203 |
-
###
|
| 204 |
-
|
| 205 |
-
#### Type `float_round_style` <a id="round.style">[[round.style]]</a>
|
| 206 |
|
| 207 |
``` cpp
|
| 208 |
namespace std {
|
| 209 |
enum float_round_style {
|
| 210 |
round_indeterminate = -1,
|
|
@@ -225,32 +285,14 @@ values:
|
|
| 225 |
representable value
|
| 226 |
- `round_toward_infinity` if the rounding style is toward infinity
|
| 227 |
- `round_toward_neg_infinity` if the rounding style is toward negative
|
| 228 |
infinity
|
| 229 |
|
| 230 |
-
#### Type `float_denorm_style` <a id="denorm.style">[[denorm.style]]</a>
|
| 231 |
-
|
| 232 |
-
``` cpp
|
| 233 |
-
namespace std {
|
| 234 |
-
enum float_denorm_style {
|
| 235 |
-
denorm_indeterminate = -1,
|
| 236 |
-
denorm_absent = 0,
|
| 237 |
-
denorm_present = 1
|
| 238 |
-
};
|
| 239 |
-
}
|
| 240 |
-
```
|
| 241 |
-
|
| 242 |
-
The presence or absence of subnormal numbers (variable number of
|
| 243 |
-
exponent bits) is characterized by the values:
|
| 244 |
-
|
| 245 |
-
- `denorm_indeterminate` if it cannot be determined whether or not the
|
| 246 |
-
type allows subnormal values
|
| 247 |
-
- `denorm_absent` if the type does not allow subnormal values
|
| 248 |
-
- `denorm_present` if the type does allow subnormal values
|
| 249 |
-
|
| 250 |
### Class template `numeric_limits` <a id="numeric.limits">[[numeric.limits]]</a>
|
| 251 |
|
|
|
|
|
|
|
| 252 |
The `numeric_limits` class template provides a C++ program with
|
| 253 |
information about various properties of the implementation’s
|
| 254 |
representation of the arithmetic types.
|
| 255 |
|
| 256 |
``` cpp
|
|
@@ -278,12 +320,10 @@ namespace std {
|
|
| 278 |
static constexpr int max_exponent10 = 0;
|
| 279 |
|
| 280 |
static constexpr bool has_infinity = false;
|
| 281 |
static constexpr bool has_quiet_NaN = false;
|
| 282 |
static constexpr bool has_signaling_NaN = false;
|
| 283 |
-
static constexpr float_denorm_style has_denorm = denorm_absent;
|
| 284 |
-
static constexpr bool has_denorm_loss = false;
|
| 285 |
static constexpr T infinity() noexcept { return T(); }
|
| 286 |
static constexpr T quiet_NaN() noexcept { return T(); }
|
| 287 |
static constexpr T signaling_NaN() noexcept { return T(); }
|
| 288 |
static constexpr T denorm_min() noexcept { return T(); }
|
| 289 |
|
|
@@ -300,12 +340,16 @@ namespace std {
|
|
| 300 |
|
| 301 |
For all members declared `static` `constexpr` in the `numeric_limits`
|
| 302 |
template, specializations shall define these values in such a way that
|
| 303 |
they are usable as constant expressions.
|
| 304 |
|
| 305 |
-
|
| 306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 307 |
|
| 308 |
Specializations shall be provided for each arithmetic type, both
|
| 309 |
floating-point and integer, including `bool`. The member
|
| 310 |
`is_specialized` shall be `true` for all such specializations of
|
| 311 |
`numeric_limits`.
|
|
@@ -497,96 +541,82 @@ Number”.[^17]
|
|
| 497 |
|
| 498 |
Meaningful for all floating-point types.
|
| 499 |
|
| 500 |
Shall be `true` for all specializations in which `is_iec559 != false`.
|
| 501 |
|
| 502 |
-
``` cpp
|
| 503 |
-
static constexpr float_denorm_style has_denorm;
|
| 504 |
-
```
|
| 505 |
-
|
| 506 |
-
`denorm_present` if the type allows subnormal values (variable number of
|
| 507 |
-
exponent bits)[^18], `denorm_absent` if the type does not allow
|
| 508 |
-
subnormal values, and `denorm_indeterminate` if it is indeterminate at
|
| 509 |
-
compile time whether the type allows subnormal values.
|
| 510 |
-
|
| 511 |
-
Meaningful for all floating-point types.
|
| 512 |
-
|
| 513 |
-
``` cpp
|
| 514 |
-
static constexpr bool has_denorm_loss;
|
| 515 |
-
```
|
| 516 |
-
|
| 517 |
-
`true` if loss of accuracy is detected as a denormalization loss, rather
|
| 518 |
-
than as an inexact result.[^19]
|
| 519 |
-
|
| 520 |
``` cpp
|
| 521 |
static constexpr T infinity() noexcept;
|
| 522 |
```
|
| 523 |
|
| 524 |
-
Representation of positive infinity, if available.[^
|
| 525 |
|
| 526 |
Meaningful for all specializations for which `has_infinity != false`.
|
| 527 |
Required in specializations for which `is_iec559 != false`.
|
| 528 |
|
| 529 |
``` cpp
|
| 530 |
static constexpr T quiet_NaN() noexcept;
|
| 531 |
```
|
| 532 |
|
| 533 |
-
Representation of a quiet “Not a Number”, if available.[^
|
| 534 |
|
| 535 |
Meaningful for all specializations for which `has_quiet_NaN != false`.
|
| 536 |
Required in specializations for which `is_iec559 != false`.
|
| 537 |
|
| 538 |
``` cpp
|
| 539 |
static constexpr T signaling_NaN() noexcept;
|
| 540 |
```
|
| 541 |
|
| 542 |
-
Representation of a signaling “Not a Number”, if available.[^
|
| 543 |
|
| 544 |
Meaningful for all specializations for which
|
| 545 |
`has_signaling_NaN != false`. Required in specializations for which
|
| 546 |
`is_iec559 != false`.
|
| 547 |
|
| 548 |
``` cpp
|
| 549 |
static constexpr T denorm_min() noexcept;
|
| 550 |
```
|
| 551 |
|
| 552 |
-
Minimum positive subnormal value.[^
|
|
|
|
|
|
|
| 553 |
|
| 554 |
Meaningful for all floating-point types.
|
| 555 |
|
| 556 |
-
In specializations for which `has_denorm == false`, returns the minimum
|
| 557 |
-
positive normalized value.
|
| 558 |
-
|
| 559 |
``` cpp
|
| 560 |
static constexpr bool is_iec559;
|
| 561 |
```
|
| 562 |
|
| 563 |
-
`true` if and only if the type adheres to ISO/IEC/IEEE 60559.[^
|
|
|
|
|
|
|
|
|
|
|
|
|
| 564 |
|
| 565 |
Meaningful for all floating-point types.
|
| 566 |
|
| 567 |
``` cpp
|
| 568 |
static constexpr bool is_bounded;
|
| 569 |
```
|
| 570 |
|
| 571 |
-
`true` if the set of values representable by the type is finite.[^
|
| 572 |
|
| 573 |
-
[*Note
|
| 574 |
This member would be `false` for arbitrary precision
|
| 575 |
types. — *end note*]
|
| 576 |
|
| 577 |
Meaningful for all specializations.
|
| 578 |
|
| 579 |
``` cpp
|
| 580 |
static constexpr bool is_modulo;
|
| 581 |
```
|
| 582 |
|
| 583 |
-
`true` if the type is modulo.[^
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
`max()
|
|
|
|
| 588 |
|
| 589 |
[*Example 1*: `is_modulo` is `false` for signed integer
|
| 590 |
types [[basic.fundamental]] unless an implementation, as an extension to
|
| 591 |
this document, defines signed integer overflow to
|
| 592 |
wrap. — *end example*]
|
|
@@ -596,27 +626,27 @@ Meaningful for all specializations.
|
|
| 596 |
``` cpp
|
| 597 |
static constexpr bool traps;
|
| 598 |
```
|
| 599 |
|
| 600 |
`true` if, at the start of the program, there exists a value of the type
|
| 601 |
-
that would cause an arithmetic operation using that value to trap.[^
|
| 602 |
|
| 603 |
Meaningful for all specializations.
|
| 604 |
|
| 605 |
``` cpp
|
| 606 |
static constexpr bool tinyness_before;
|
| 607 |
```
|
| 608 |
|
| 609 |
-
`true` if tinyness is detected before rounding.[^
|
| 610 |
|
| 611 |
Meaningful for all floating-point types.
|
| 612 |
|
| 613 |
``` cpp
|
| 614 |
static constexpr float_round_style round_style;
|
| 615 |
```
|
| 616 |
|
| 617 |
-
The rounding style for the type.[^
|
| 618 |
|
| 619 |
Meaningful for all floating-point types. Specializations for integer
|
| 620 |
types shall return `round_toward_zero`.
|
| 621 |
|
| 622 |
#### `numeric_limits` specializations <a id="numeric.special">[[numeric.special]]</a>
|
|
@@ -656,12 +686,10 @@ namespace std {
|
|
| 656 |
static constexpr int max_exponent10 = + 38;
|
| 657 |
|
| 658 |
static constexpr bool has_infinity = true;
|
| 659 |
static constexpr bool has_quiet_NaN = true;
|
| 660 |
static constexpr bool has_signaling_NaN = true;
|
| 661 |
-
static constexpr float_denorm_style has_denorm = denorm_absent;
|
| 662 |
-
static constexpr bool has_denorm_loss = false;
|
| 663 |
|
| 664 |
static constexpr float infinity() noexcept { return value; }
|
| 665 |
static constexpr float quiet_NaN() noexcept { return value; }
|
| 666 |
static constexpr float signaling_NaN() noexcept { return value; }
|
| 667 |
static constexpr float denorm_min() noexcept { return min(); }
|
|
@@ -707,12 +735,10 @@ namespace std {
|
|
| 707 |
static constexpr int max_exponent10 = 0;
|
| 708 |
|
| 709 |
static constexpr bool has_infinity = false;
|
| 710 |
static constexpr bool has_quiet_NaN = false;
|
| 711 |
static constexpr bool has_signaling_NaN = false;
|
| 712 |
-
static constexpr float_denorm_style has_denorm = denorm_absent;
|
| 713 |
-
static constexpr bool has_denorm_loss = false;
|
| 714 |
static constexpr bool infinity() noexcept { return 0; }
|
| 715 |
static constexpr bool quiet_NaN() noexcept { return 0; }
|
| 716 |
static constexpr bool signaling_NaN() noexcept { return 0; }
|
| 717 |
static constexpr bool denorm_min() noexcept { return 0; }
|
| 718 |
|
|
@@ -728,10 +754,11 @@ namespace std {
|
|
| 728 |
```
|
| 729 |
|
| 730 |
### Header `<climits>` synopsis <a id="climits.syn">[[climits.syn]]</a>
|
| 731 |
|
| 732 |
``` cpp
|
|
|
|
| 733 |
#define CHAR_BIT see below
|
| 734 |
#define SCHAR_MIN see below
|
| 735 |
#define SCHAR_MAX see below
|
| 736 |
#define UCHAR_MAX see below
|
| 737 |
#define CHAR_MIN see below
|
|
@@ -752,19 +779,20 @@ namespace std {
|
|
| 752 |
```
|
| 753 |
|
| 754 |
The header `<climits>` defines all macros the same as the C standard
|
| 755 |
library header `<limits.h>`.
|
| 756 |
|
| 757 |
-
[*Note 1*:
|
| 758 |
-
|
| 759 |
-
|
| 760 |
|
| 761 |
See also: ISO C 5.2.4.2.1
|
| 762 |
|
| 763 |
### Header `<cfloat>` synopsis <a id="cfloat.syn">[[cfloat.syn]]</a>
|
| 764 |
|
| 765 |
``` cpp
|
|
|
|
| 766 |
#define FLT_ROUNDS see below
|
| 767 |
#define FLT_EVAL_METHOD see below
|
| 768 |
#define FLT_HAS_SUBNORM see below
|
| 769 |
#define DBL_HAS_SUBNORM see below
|
| 770 |
#define LDBL_HAS_SUBNORM see below
|
|
|
|
| 13 |
|
| 14 |
Each of the macros defined in `<version>` is also defined after
|
| 15 |
inclusion of any member of the set of library headers indicated in the
|
| 16 |
corresponding comment in this synopsis.
|
| 17 |
|
| 18 |
+
[*Note 1*: Future revisions of C++ might replace the values of these
|
| 19 |
+
macros with greater values. — *end note*]
|
| 20 |
|
| 21 |
``` cpp
|
| 22 |
#define __cpp_lib_addressof_constexpr 201603L // also in <memory>
|
| 23 |
+
#define __cpp_lib_algorithm_iterator_requirements 202207L
|
| 24 |
+
// also in <algorithm>, <numeric>, <memory>
|
| 25 |
+
#define __cpp_lib_allocate_at_least 202302L // also in <memory>
|
| 26 |
#define __cpp_lib_allocator_traits_is_always_equal 201411L
|
| 27 |
// also in <memory>, <scoped_allocator>, <string>, <deque>, <forward_list>, <list>, <vector>,
|
| 28 |
// <map>, <set>, <unordered_map>, <unordered_set>
|
| 29 |
+
#define __cpp_lib_adaptor_iterator_pair_constructor 202106L // also in <stack>, <queue>
|
| 30 |
#define __cpp_lib_any 201606L // also in <any>
|
| 31 |
#define __cpp_lib_apply 201603L // also in <tuple>
|
| 32 |
#define __cpp_lib_array_constexpr 201811L // also in <iterator>, <array>
|
| 33 |
#define __cpp_lib_as_const 201510L // also in <utility>
|
| 34 |
+
#define __cpp_lib_associative_heterogeneous_erasure 202110L
|
| 35 |
+
// also in <map>, <set>, <unordered_map>, <unordered_set>
|
| 36 |
#define __cpp_lib_assume_aligned 201811L // also in <memory>
|
| 37 |
#define __cpp_lib_atomic_flag_test 201907L // also in <atomic>
|
| 38 |
#define __cpp_lib_atomic_float 201711L // also in <atomic>
|
| 39 |
#define __cpp_lib_atomic_is_always_lock_free 201603L // also in <atomic>
|
| 40 |
#define __cpp_lib_atomic_lock_free_type_aliases 201907L // also in <atomic>
|
| 41 |
#define __cpp_lib_atomic_ref 201806L // also in <atomic>
|
| 42 |
#define __cpp_lib_atomic_shared_ptr 201711L // also in <memory>
|
| 43 |
#define __cpp_lib_atomic_value_initialization 201911L // also in <atomic>, <memory>
|
| 44 |
#define __cpp_lib_atomic_wait 201907L // also in <atomic>
|
| 45 |
+
#define __cpp_lib_barrier 202302L // also in <barrier>
|
| 46 |
+
#define __cpp_lib_bind_back 202202L // also in <functional>
|
| 47 |
#define __cpp_lib_bind_front 201907L // also in <functional>
|
| 48 |
#define __cpp_lib_bit_cast 201806L // also in <bit>
|
| 49 |
#define __cpp_lib_bitops 201907L // also in <bit>
|
| 50 |
#define __cpp_lib_bool_constant 201505L // also in <type_traits>
|
| 51 |
#define __cpp_lib_bounded_array_traits 201902L // also in <type_traits>
|
| 52 |
#define __cpp_lib_boyer_moore_searcher 201603L // also in <functional>
|
| 53 |
#define __cpp_lib_byte 201603L // also in <cstddef>
|
| 54 |
+
#define __cpp_lib_byteswap 202110L // also in <bit>
|
| 55 |
#define __cpp_lib_char8_t 201907L
|
| 56 |
// also in <atomic>, <filesystem>, <istream>, <limits>, <locale>, <ostream>, <string>, <string_view>
|
| 57 |
#define __cpp_lib_chrono 201907L // also in <chrono>
|
| 58 |
#define __cpp_lib_chrono_udls 201304L // also in <chrono>
|
| 59 |
#define __cpp_lib_clamp 201603L // also in <algorithm>
|
| 60 |
+
#define __cpp_lib_common_reference 202302L // also in <type_traits>
|
| 61 |
+
#define __cpp_lib_common_reference_wrapper 202302L // also in <functional>
|
| 62 |
#define __cpp_lib_complex_udls 201309L // also in <complex>
|
| 63 |
+
#define __cpp_lib_concepts 202207L // also in <concepts>, <compare>
|
| 64 |
+
#define __cpp_lib_constexpr_algorithms 201806L // also in <algorithm>, <utility>
|
| 65 |
+
#define __cpp_lib_constexpr_bitset 202207L // also in <bitset>
|
| 66 |
+
#define __cpp_lib_constexpr_charconv 202207L // also in <charconv>
|
| 67 |
+
#define __cpp_lib_constexpr_cmath 202202L // also in <cmath>, <cstdlib>
|
| 68 |
#define __cpp_lib_constexpr_complex 201711L // also in <complex>
|
| 69 |
#define __cpp_lib_constexpr_dynamic_alloc 201907L // also in <memory>
|
| 70 |
#define __cpp_lib_constexpr_functional 201907L // also in <functional>
|
| 71 |
#define __cpp_lib_constexpr_iterator 201811L // also in <iterator>
|
| 72 |
+
#define __cpp_lib_constexpr_memory 202202L // also in <memory>
|
| 73 |
#define __cpp_lib_constexpr_numeric 201911L // also in <numeric>
|
| 74 |
#define __cpp_lib_constexpr_string 201907L // also in <string>
|
| 75 |
#define __cpp_lib_constexpr_string_view 201811L // also in <string_view>
|
| 76 |
#define __cpp_lib_constexpr_tuple 201811L // also in <tuple>
|
| 77 |
+
#define __cpp_lib_constexpr_typeinfo 202106L // also in <typeinfo>
|
| 78 |
#define __cpp_lib_constexpr_utility 201811L // also in <utility>
|
| 79 |
#define __cpp_lib_constexpr_vector 201907L // also in <vector>
|
| 80 |
+
#define __cpp_lib_containers_ranges 202202L
|
| 81 |
+
// also in <vector>, <list>, <forward_list>, <map>, <set>, <unordered_map>, <unordered_set>,
|
| 82 |
+
// <deque>, <queue>, <stack>, <string>
|
| 83 |
#define __cpp_lib_coroutine 201902L // also in <coroutine>
|
| 84 |
#define __cpp_lib_destroying_delete 201806L // also in <new>
|
| 85 |
#define __cpp_lib_enable_shared_from_this 201603L // also in <memory>
|
| 86 |
#define __cpp_lib_endian 201907L // also in <bit>
|
| 87 |
#define __cpp_lib_erase_if 202002L
|
| 88 |
// also in <string>, <deque>, <forward_list>, <list>, <vector>, <map>, <set>, <unordered_map>,
|
| 89 |
// <unordered_set>
|
| 90 |
#define __cpp_lib_exchange_function 201304L // also in <utility>
|
| 91 |
#define __cpp_lib_execution 201902L // also in <execution>
|
| 92 |
+
#define __cpp_lib_expected 202211L // also in <expected>
|
| 93 |
#define __cpp_lib_filesystem 201703L // also in <filesystem>
|
| 94 |
+
#define __cpp_lib_flat_map 202207L // also in <flat_map>
|
| 95 |
+
#define __cpp_lib_flat_set 202207L // also in <flat_set>
|
| 96 |
+
#define __cpp_lib_format 202207L // also in <format>
|
| 97 |
+
#define __cpp_lib_format_ranges 202207L // also in <format>
|
| 98 |
+
#define __cpp_lib_formatters 202302L // also in <stacktrace>, <thread>
|
| 99 |
+
#define __cpp_lib_forward_like 202207L // also in <utility>
|
| 100 |
#define __cpp_lib_gcd_lcm 201606L // also in <numeric>
|
| 101 |
+
#define __cpp_lib_generator 202207L // also in <generator>
|
| 102 |
#define __cpp_lib_generic_associative_lookup 201304L // also in <map>, <set>
|
| 103 |
#define __cpp_lib_generic_unordered_lookup 201811L
|
| 104 |
// also in <unordered_map>, <unordered_set>
|
| 105 |
#define __cpp_lib_hardware_interference_size 201703L // also in <new>
|
| 106 |
#define __cpp_lib_has_unique_object_representations 201606L // also in <type_traits>
|
|
|
|
| 111 |
#define __cpp_lib_integer_comparison_functions 202002L // also in <utility>
|
| 112 |
#define __cpp_lib_integer_sequence 201304L // also in <utility>
|
| 113 |
#define __cpp_lib_integral_constant_callable 201304L // also in <type_traits>
|
| 114 |
#define __cpp_lib_interpolate 201902L // also in <cmath>, <numeric>
|
| 115 |
#define __cpp_lib_invoke 201411L // also in <functional>
|
| 116 |
+
#define __cpp_lib_invoke_r 202106L // also in <functional>
|
| 117 |
+
#define __cpp_lib_ios_noreplace 202207L // also in <ios>
|
| 118 |
#define __cpp_lib_is_aggregate 201703L // also in <type_traits>
|
| 119 |
#define __cpp_lib_is_constant_evaluated 201811L // also in <type_traits>
|
| 120 |
#define __cpp_lib_is_final 201402L // also in <type_traits>
|
| 121 |
+
#define __cpp_lib_is_implicit_lifetime 202302L // also in <type_traits>
|
| 122 |
#define __cpp_lib_is_invocable 201703L // also in <type_traits>
|
| 123 |
#define __cpp_lib_is_layout_compatible 201907L // also in <type_traits>
|
| 124 |
#define __cpp_lib_is_nothrow_convertible 201806L // also in <type_traits>
|
| 125 |
#define __cpp_lib_is_null_pointer 201309L // also in <type_traits>
|
| 126 |
#define __cpp_lib_is_pointer_interconvertible 201907L // also in <type_traits>
|
| 127 |
+
#define __cpp_lib_is_scoped_enum 202011L // also in <type_traits>
|
| 128 |
#define __cpp_lib_is_swappable 201603L // also in <type_traits>
|
| 129 |
#define __cpp_lib_jthread 201911L // also in <stop_token>, <thread>
|
| 130 |
#define __cpp_lib_latch 201907L // also in <latch>
|
| 131 |
#define __cpp_lib_launder 201606L // also in <new>
|
| 132 |
#define __cpp_lib_list_remove_return_type 201806L // also in <forward_list>, <list>
|
|
|
|
| 135 |
#define __cpp_lib_make_reverse_iterator 201402L // also in <iterator>
|
| 136 |
#define __cpp_lib_make_unique 201304L // also in <memory>
|
| 137 |
#define __cpp_lib_map_try_emplace 201411L // also in <map>
|
| 138 |
#define __cpp_lib_math_constants 201907L // also in <numbers>
|
| 139 |
#define __cpp_lib_math_special_functions 201603L // also in <cmath>
|
| 140 |
+
#define __cpp_lib_mdspan 202207L // also in <mdspan>
|
| 141 |
#define __cpp_lib_memory_resource 201603L // also in <memory_resource>
|
| 142 |
+
#define __cpp_lib_modules 202207L
|
| 143 |
+
#define __cpp_lib_move_iterator_concept 202207L // also in <iterator>
|
| 144 |
+
#define __cpp_lib_move_only_function 202110L // also in <functional>
|
| 145 |
#define __cpp_lib_node_extract 201606L
|
| 146 |
// also in <map>, <set>, <unordered_map>, <unordered_set>
|
| 147 |
#define __cpp_lib_nonmember_container_access 201411L
|
| 148 |
// also in <array>, <deque>, <forward_list>, <iterator>, <list>, <map>, <regex>, <set>, <string>,
|
| 149 |
// <unordered_map>, <unordered_set>, <vector>
|
| 150 |
#define __cpp_lib_not_fn 201603L // also in <functional>
|
| 151 |
#define __cpp_lib_null_iterators 201304L // also in <iterator>
|
| 152 |
+
#define __cpp_lib_optional 202110L // also in <optional>
|
| 153 |
+
#define __cpp_lib_out_ptr 202106L // also in <memory>
|
| 154 |
#define __cpp_lib_parallel_algorithm 201603L // also in <algorithm>, <numeric>
|
| 155 |
+
#define __cpp_lib_polymorphic_allocator 201902L // also in <memory_resource>
|
| 156 |
+
#define __cpp_lib_print 202207L // also in <print>, <ostream>
|
| 157 |
#define __cpp_lib_quoted_string_io 201304L // also in <iomanip>
|
| 158 |
+
#define __cpp_lib_ranges 202302L
|
| 159 |
// also in <algorithm>, <functional>, <iterator>, <memory>, <ranges>
|
| 160 |
+
#define __cpp_lib_ranges_as_const 202207L // also in <ranges>
|
| 161 |
+
#define __cpp_lib_ranges_as_rvalue 202207L // also in <ranges>
|
| 162 |
+
#define __cpp_lib_ranges_cartesian_product 202207L // also in <ranges>
|
| 163 |
+
#define __cpp_lib_ranges_chunk 202202L // also in <ranges>
|
| 164 |
+
#define __cpp_lib_ranges_chunk_by 202202L // also in <ranges>
|
| 165 |
+
#define __cpp_lib_ranges_contains 202207L // also in <algorithm>
|
| 166 |
+
#define __cpp_lib_ranges_enumerate 202302L // also in <ranges>, <version>
|
| 167 |
+
#define __cpp_lib_ranges_find_last 202207L // also in <algorithm>
|
| 168 |
+
#define __cpp_lib_ranges_fold 202207L // also in <algorithm>
|
| 169 |
+
#define __cpp_lib_ranges_iota 202202L // also in <numeric>
|
| 170 |
+
#define __cpp_lib_ranges_join_with 202202L // also in <ranges>
|
| 171 |
+
#define __cpp_lib_ranges_repeat 202207L // also in <ranges>
|
| 172 |
+
#define __cpp_lib_ranges_slide 202202L // also in <ranges>
|
| 173 |
+
#define __cpp_lib_ranges_starts_ends_with 202106L // also in <algorithm>
|
| 174 |
+
#define __cpp_lib_ranges_stride 202207L // also in <ranges>
|
| 175 |
+
#define __cpp_lib_ranges_to_container 202202L // also in <ranges>
|
| 176 |
+
#define __cpp_lib_ranges_zip 202110L // also in <ranges>, <tuple>, <utility>
|
| 177 |
#define __cpp_lib_raw_memory_algorithms 201606L // also in <memory>
|
| 178 |
+
#define __cpp_lib_reference_from_temporary 202202L // also in <type_traits>
|
| 179 |
#define __cpp_lib_remove_cvref 201711L // also in <type_traits>
|
| 180 |
#define __cpp_lib_result_of_sfinae 201210L // also in <functional>, <type_traits>
|
| 181 |
#define __cpp_lib_robust_nonmodifying_seq_ops 201304L // also in <algorithm>
|
| 182 |
#define __cpp_lib_sample 201603L // also in <algorithm>
|
| 183 |
#define __cpp_lib_scoped_lock 201703L // also in <mutex>
|
| 184 |
#define __cpp_lib_semaphore 201907L // also in <semaphore>
|
| 185 |
#define __cpp_lib_shared_mutex 201505L // also in <shared_mutex>
|
| 186 |
#define __cpp_lib_shared_ptr_arrays 201707L // also in <memory>
|
| 187 |
#define __cpp_lib_shared_ptr_weak_type 201606L // also in <memory>
|
| 188 |
#define __cpp_lib_shared_timed_mutex 201402L // also in <shared_mutex>
|
| 189 |
+
#define __cpp_lib_shift 202202L // also in <algorithm>
|
| 190 |
#define __cpp_lib_smart_ptr_for_overwrite 202002L // also in <memory>
|
| 191 |
#define __cpp_lib_source_location 201907L // also in <source_location>
|
| 192 |
#define __cpp_lib_span 202002L // also in <span>
|
| 193 |
+
#define __cpp_lib_spanstream 202106L // also in <spanstream>
|
| 194 |
#define __cpp_lib_ssize 201902L // also in <iterator>
|
| 195 |
+
#define __cpp_lib_stacktrace 202011L // also in <stacktrace>
|
| 196 |
+
#define __cpp_lib_start_lifetime_as 202207L // also in <memory>
|
| 197 |
#define __cpp_lib_starts_ends_with 201711L // also in <string>, <string_view>
|
| 198 |
+
#define __cpp_lib_stdatomic_h 202011L // also in <stdatomic.h>
|
| 199 |
+
#define __cpp_lib_string_contains 202011L // also in <string>, <string_view>
|
| 200 |
+
#define __cpp_lib_string_resize_and_overwrite 202110L // also in <string>
|
| 201 |
#define __cpp_lib_string_udls 201304L // also in <string>
|
| 202 |
#define __cpp_lib_string_view 201803L // also in <string>, <string_view>
|
| 203 |
#define __cpp_lib_syncbuf 201803L // also in <syncstream>
|
| 204 |
#define __cpp_lib_three_way_comparison 201907L // also in <compare>
|
| 205 |
#define __cpp_lib_to_address 201711L // also in <memory>
|
| 206 |
#define __cpp_lib_to_array 201907L // also in <array>
|
| 207 |
#define __cpp_lib_to_chars 201611L // also in <charconv>
|
| 208 |
+
#define __cpp_lib_to_underlying 202102L // also in <utility>
|
| 209 |
#define __cpp_lib_transformation_trait_aliases 201304L // also in <type_traits>
|
| 210 |
#define __cpp_lib_transparent_operators 201510L // also in <memory>, <functional>
|
| 211 |
+
#define __cpp_lib_tuple_like 202207L
|
| 212 |
+
// also in <utility>, <tuple>, <map>, <unordered_map>
|
| 213 |
#define __cpp_lib_tuple_element_t 201402L // also in <tuple>
|
| 214 |
#define __cpp_lib_tuples_by_type 201304L // also in <utility>, <tuple>
|
| 215 |
#define __cpp_lib_type_identity 201806L // also in <type_traits>
|
| 216 |
#define __cpp_lib_type_trait_variable_templates 201510L // also in <type_traits>
|
| 217 |
#define __cpp_lib_uncaught_exceptions 201411L // also in <exception>
|
| 218 |
#define __cpp_lib_unordered_map_try_emplace 201411L // also in <unordered_map>
|
| 219 |
+
#define __cpp_lib_unreachable 202202L // also in <utility>
|
| 220 |
#define __cpp_lib_unwrap_ref 201811L // also in <type_traits>
|
| 221 |
+
#define __cpp_lib_variant 202106L // also in <variant>
|
| 222 |
#define __cpp_lib_void_t 201411L // also in <type_traits>
|
| 223 |
```
|
| 224 |
|
| 225 |
### Header `<limits>` synopsis <a id="limits.syn">[[limits.syn]]</a>
|
| 226 |
|
| 227 |
``` cpp
|
| 228 |
+
// all freestanding
|
| 229 |
namespace std {
|
| 230 |
+
// [round.style], enumeration float_round_style
|
| 231 |
enum float_round_style;
|
|
|
|
| 232 |
|
| 233 |
// [numeric.limits], class template numeric_limits
|
| 234 |
template<class T> class numeric_limits;
|
| 235 |
|
| 236 |
template<class T> class numeric_limits<const T>;
|
|
|
|
| 260 |
template<> class numeric_limits<double>;
|
| 261 |
template<> class numeric_limits<long double>;
|
| 262 |
}
|
| 263 |
```
|
| 264 |
|
| 265 |
+
### Enum `float_round_style` <a id="round.style">[[round.style]]</a>
|
|
|
|
|
|
|
| 266 |
|
| 267 |
``` cpp
|
| 268 |
namespace std {
|
| 269 |
enum float_round_style {
|
| 270 |
round_indeterminate = -1,
|
|
|
|
| 285 |
representable value
|
| 286 |
- `round_toward_infinity` if the rounding style is toward infinity
|
| 287 |
- `round_toward_neg_infinity` if the rounding style is toward negative
|
| 288 |
infinity
|
| 289 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
### Class template `numeric_limits` <a id="numeric.limits">[[numeric.limits]]</a>
|
| 291 |
|
| 292 |
+
#### General <a id="numeric.limits.general">[[numeric.limits.general]]</a>
|
| 293 |
+
|
| 294 |
The `numeric_limits` class template provides a C++ program with
|
| 295 |
information about various properties of the implementation’s
|
| 296 |
representation of the arithmetic types.
|
| 297 |
|
| 298 |
``` cpp
|
|
|
|
| 320 |
static constexpr int max_exponent10 = 0;
|
| 321 |
|
| 322 |
static constexpr bool has_infinity = false;
|
| 323 |
static constexpr bool has_quiet_NaN = false;
|
| 324 |
static constexpr bool has_signaling_NaN = false;
|
|
|
|
|
|
|
| 325 |
static constexpr T infinity() noexcept { return T(); }
|
| 326 |
static constexpr T quiet_NaN() noexcept { return T(); }
|
| 327 |
static constexpr T signaling_NaN() noexcept { return T(); }
|
| 328 |
static constexpr T denorm_min() noexcept { return T(); }
|
| 329 |
|
|
|
|
| 340 |
|
| 341 |
For all members declared `static` `constexpr` in the `numeric_limits`
|
| 342 |
template, specializations shall define these values in such a way that
|
| 343 |
they are usable as constant expressions.
|
| 344 |
|
| 345 |
+
For the `numeric_limits` primary template, all data members are
|
| 346 |
+
value-initialized and all member functions return a value-initialized
|
| 347 |
+
object.
|
| 348 |
+
|
| 349 |
+
[*Note 1*: This means all members have zero or `false` values unless
|
| 350 |
+
`numeric_limits` is specialized for a type. — *end note*]
|
| 351 |
|
| 352 |
Specializations shall be provided for each arithmetic type, both
|
| 353 |
floating-point and integer, including `bool`. The member
|
| 354 |
`is_specialized` shall be `true` for all such specializations of
|
| 355 |
`numeric_limits`.
|
|
|
|
| 541 |
|
| 542 |
Meaningful for all floating-point types.
|
| 543 |
|
| 544 |
Shall be `true` for all specializations in which `is_iec559 != false`.
|
| 545 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 546 |
``` cpp
|
| 547 |
static constexpr T infinity() noexcept;
|
| 548 |
```
|
| 549 |
|
| 550 |
+
Representation of positive infinity, if available.[^18]
|
| 551 |
|
| 552 |
Meaningful for all specializations for which `has_infinity != false`.
|
| 553 |
Required in specializations for which `is_iec559 != false`.
|
| 554 |
|
| 555 |
``` cpp
|
| 556 |
static constexpr T quiet_NaN() noexcept;
|
| 557 |
```
|
| 558 |
|
| 559 |
+
Representation of a quiet “Not a Number”, if available.[^19]
|
| 560 |
|
| 561 |
Meaningful for all specializations for which `has_quiet_NaN != false`.
|
| 562 |
Required in specializations for which `is_iec559 != false`.
|
| 563 |
|
| 564 |
``` cpp
|
| 565 |
static constexpr T signaling_NaN() noexcept;
|
| 566 |
```
|
| 567 |
|
| 568 |
+
Representation of a signaling “Not a Number”, if available.[^20]
|
| 569 |
|
| 570 |
Meaningful for all specializations for which
|
| 571 |
`has_signaling_NaN != false`. Required in specializations for which
|
| 572 |
`is_iec559 != false`.
|
| 573 |
|
| 574 |
``` cpp
|
| 575 |
static constexpr T denorm_min() noexcept;
|
| 576 |
```
|
| 577 |
|
| 578 |
+
Minimum positive subnormal value, if available.[^21]
|
| 579 |
+
|
| 580 |
+
Otherwise, minimum positive normalized value.
|
| 581 |
|
| 582 |
Meaningful for all floating-point types.
|
| 583 |
|
|
|
|
|
|
|
|
|
|
| 584 |
``` cpp
|
| 585 |
static constexpr bool is_iec559;
|
| 586 |
```
|
| 587 |
|
| 588 |
+
`true` if and only if the type adheres to ISO/IEC/IEEE 60559.[^22]
|
| 589 |
+
|
| 590 |
+
[*Note 1*: The value is `true` for any of the types `float16_t`,
|
| 591 |
+
`float32_t`, `float64_t`, or `float128_t`, if
|
| 592 |
+
present [[basic.extended.fp]]. — *end note*]
|
| 593 |
|
| 594 |
Meaningful for all floating-point types.
|
| 595 |
|
| 596 |
``` cpp
|
| 597 |
static constexpr bool is_bounded;
|
| 598 |
```
|
| 599 |
|
| 600 |
+
`true` if the set of values representable by the type is finite.[^23]
|
| 601 |
|
| 602 |
+
[*Note 2*: All fundamental types [[basic.fundamental]] are bounded.
|
| 603 |
This member would be `false` for arbitrary precision
|
| 604 |
types. — *end note*]
|
| 605 |
|
| 606 |
Meaningful for all specializations.
|
| 607 |
|
| 608 |
``` cpp
|
| 609 |
static constexpr bool is_modulo;
|
| 610 |
```
|
| 611 |
|
| 612 |
+
`true` if the type is modulo.[^24]
|
| 613 |
+
|
| 614 |
+
A type is modulo if, for any operation involving `+`, `-`, or `*` on
|
| 615 |
+
values of that type whose result would fall outside the range \[`min()`,
|
| 616 |
+
`max()`\], the value returned differs from the true value by an integer
|
| 617 |
+
multiple of `max() - min() + 1`.
|
| 618 |
|
| 619 |
[*Example 1*: `is_modulo` is `false` for signed integer
|
| 620 |
types [[basic.fundamental]] unless an implementation, as an extension to
|
| 621 |
this document, defines signed integer overflow to
|
| 622 |
wrap. — *end example*]
|
|
|
|
| 626 |
``` cpp
|
| 627 |
static constexpr bool traps;
|
| 628 |
```
|
| 629 |
|
| 630 |
`true` if, at the start of the program, there exists a value of the type
|
| 631 |
+
that would cause an arithmetic operation using that value to trap.[^25]
|
| 632 |
|
| 633 |
Meaningful for all specializations.
|
| 634 |
|
| 635 |
``` cpp
|
| 636 |
static constexpr bool tinyness_before;
|
| 637 |
```
|
| 638 |
|
| 639 |
+
`true` if tinyness is detected before rounding.[^26]
|
| 640 |
|
| 641 |
Meaningful for all floating-point types.
|
| 642 |
|
| 643 |
``` cpp
|
| 644 |
static constexpr float_round_style round_style;
|
| 645 |
```
|
| 646 |
|
| 647 |
+
The rounding style for the type.[^27]
|
| 648 |
|
| 649 |
Meaningful for all floating-point types. Specializations for integer
|
| 650 |
types shall return `round_toward_zero`.
|
| 651 |
|
| 652 |
#### `numeric_limits` specializations <a id="numeric.special">[[numeric.special]]</a>
|
|
|
|
| 686 |
static constexpr int max_exponent10 = + 38;
|
| 687 |
|
| 688 |
static constexpr bool has_infinity = true;
|
| 689 |
static constexpr bool has_quiet_NaN = true;
|
| 690 |
static constexpr bool has_signaling_NaN = true;
|
|
|
|
|
|
|
| 691 |
|
| 692 |
static constexpr float infinity() noexcept { return value; }
|
| 693 |
static constexpr float quiet_NaN() noexcept { return value; }
|
| 694 |
static constexpr float signaling_NaN() noexcept { return value; }
|
| 695 |
static constexpr float denorm_min() noexcept { return min(); }
|
|
|
|
| 735 |
static constexpr int max_exponent10 = 0;
|
| 736 |
|
| 737 |
static constexpr bool has_infinity = false;
|
| 738 |
static constexpr bool has_quiet_NaN = false;
|
| 739 |
static constexpr bool has_signaling_NaN = false;
|
|
|
|
|
|
|
| 740 |
static constexpr bool infinity() noexcept { return 0; }
|
| 741 |
static constexpr bool quiet_NaN() noexcept { return 0; }
|
| 742 |
static constexpr bool signaling_NaN() noexcept { return 0; }
|
| 743 |
static constexpr bool denorm_min() noexcept { return 0; }
|
| 744 |
|
|
|
|
| 754 |
```
|
| 755 |
|
| 756 |
### Header `<climits>` synopsis <a id="climits.syn">[[climits.syn]]</a>
|
| 757 |
|
| 758 |
``` cpp
|
| 759 |
+
// all freestanding
|
| 760 |
#define CHAR_BIT see below
|
| 761 |
#define SCHAR_MIN see below
|
| 762 |
#define SCHAR_MAX see below
|
| 763 |
#define UCHAR_MAX see below
|
| 764 |
#define CHAR_MIN see below
|
|
|
|
| 779 |
```
|
| 780 |
|
| 781 |
The header `<climits>` defines all macros the same as the C standard
|
| 782 |
library header `<limits.h>`.
|
| 783 |
|
| 784 |
+
[*Note 1*: Except for `CHAR_BIT` and `MB_LEN_MAX`, a macro referring to
|
| 785 |
+
an integer type `T` defines a constant whose type is the promoted type
|
| 786 |
+
of `T` [[conv.prom]]. — *end note*]
|
| 787 |
|
| 788 |
See also: ISO C 5.2.4.2.1
|
| 789 |
|
| 790 |
### Header `<cfloat>` synopsis <a id="cfloat.syn">[[cfloat.syn]]</a>
|
| 791 |
|
| 792 |
``` cpp
|
| 793 |
+
// all freestanding
|
| 794 |
#define FLT_ROUNDS see below
|
| 795 |
#define FLT_EVAL_METHOD see below
|
| 796 |
#define FLT_HAS_SUBNORM see below
|
| 797 |
#define DBL_HAS_SUBNORM see below
|
| 798 |
#define LDBL_HAS_SUBNORM see below
|