The integral_constant
Struct Template Reference
Struct template representing a generic integral constant. More...
Declaration
Included Headers
Base struct
struct | op |
Empty base struct for all operator types. More... | |
Public Member Typedefs Index
template <auto N> | |
using | value_type = decltype(N) |
The type of the constant value. More... | |
Public Operators Index
template <auto N> | |
constexpr | operator value_type (void) const |
Explicit conversion operator to value_type. More... | |
template <auto N> | |
constexpr auto | operator- () const |
Unary minus operator. More... | |
Public Member Functions Index
template <auto N> | |
constexpr auto | get (void) const |
Getter for the constant value. More... | |
Public Static Attributes Index
template <auto N> | |
static constexpr auto | value = N |
The constant value. More... | |
Description
Struct template representing a generic integral constant.
- Template Parameters
-
N The compile-time constant value.
The integral_constant struct template provides a compile-time constant value of an integral type, with additional utility features. It inherits from op to enable unified handling within the µTest++ framework's type traits and metaprogramming utilities.
This struct template exposes the constant value via a static member, a getter method, and explicit conversion operators. It also provides a unary minus operator to obtain the negative value as a new integral_constant instance.
Definition at line 703 of file type-traits.h.
Public Member Typedefs
value_type
|
The type of the constant value.
Definition at line 708 of file type-traits.h.
Public Operators
operator value_type()
| inline explicit nodiscard constexpr |
Explicit conversion operator to value_type.
- Parameters
None.
- Returns
The constant value as type value_type.
Allows explicit conversion to the underlying value type.
Definition at line 741 of file type-traits.h.
operator-()
| inline nodiscard constexpr |
Unary minus operator.
- Returns
An integral_constant with value -N.
Returns a new integral_constant instance representing the negative of the current value.
Definition at line 725 of file type-traits.h.
Public Member Functions
get()
| inline nodiscard constexpr |
Getter for the constant value.
- Parameters
None.
- Returns
The constant value.
Returns the compile-time constant value.
Definition at line 757 of file type-traits.h.
Public Static Attributes
value
| constexpr static |
The constant value.
Definition at line 713 of file type-traits.h.
The documentation for this struct was generated from the following file:
Generated via doxygen2docusaurus by Doxygen 1.14.0.