Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::numbers Namespace Reference

Variable Documentation

◆ one_v

template<typename T>
T arene::base::numbers::one_v {1}
externconstexpr

The multiplicative identity of T.

Template Parameters
Tnumeric 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}:

  • is not well formed
  • does not match the required semantics
  • is not invocable within a constant expression
See also
zero_v

◆ pi_v

template<typename Type>
Type arene::base::numbers::pi_v {pi_detail::pi_v<Type>}
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.

Template Parameters
TypeThe chosen type

◆ zero_v

template<typename T>
T arene::base::numbers::zero_v {}
externconstexpr

The additive identity of T.

Template Parameters
Tnumeric 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{}:

  • is not well formed
  • does not match the required semantics
  • is not invocable within a constant expression

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):

template <>
constexpr T zero_v
The additive identity of T.