![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
|
externconstexpr |
The multiplicative identity of T.
| T | numeric type |
a * one_v<T> == a and one_v<T> * a == a are true for valid values of a of type T.
Users may specialize one_v for cv-unqualified program-defined types. A specialization is required if any of the following cases are true for the expression T{1}:
|
externconstexpr |
The value of Pi, in the specified floating point type. Type must be float or double , or a type for which an explicit specialization of pi_v has been made.
| Type | The chosen type |
|
externconstexpr |
The additive identity of T.
| T | numeric type |
a + zero_v<T> == a and zero_v<T> + a == a are true for valid values of a of type T.
Users may specialize zero_v for cv-unqualified program-defined types. A specialization is required if any of the following cases are true for the expression T{}:
A specialization may be non-constexpr; such specializations may not be used in contexts that require a constant expression.
Example of a non-constexpr specialization (for a type whose default constructor is not constexpr but does have the correct semantics):