integral_constant Struct Template
Struct template representing a generic integral constant. More...
Declaration
struct micro_os_plus::micro_test_plus::type_traits::integral_constant<N> { ... }
Included Headers
Base struct
| struct | value_base_<T> |
|
Base struct template providing common storage and accessors for runtime value-wrapper types. More... | |
Public Member Typedefs Index
template <auto N> | |
| using | value_type = decltype(N) |
|
The type of the stored value. More... | |
Public Constructors Index
template <auto N> | |
| constexpr | integral_constant () noexcept |
|
Default constructor. Initialises the base with N. More... | |
Public Operators Index
template <auto N> | |
| constexpr | operator decltype(N) () const noexcept |
|
Explicit conversion operator to the underlying value type. More... | |
template <auto N> | |
| constexpr auto | operator- () const noexcept |
|
Unary minus operator. More... | |
Public Member Functions Index
template <auto N> | |
| constexpr auto | get (void) const noexcept -> decltype(N) |
|
Getter for the stored value. More... | |
Public Member Attributes Index
template <auto N> | |
| decltype(N) | value_ |
|
The stored value. More... | |
Public Static Attributes Index
template <auto N> | |
| static constexpr auto | value = N |
|
The compile-time 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 value_base_<decltype(N)>, which supplies the value_type alias, the value_ runtime member, the explicit conversion operator, and the get() accessor.
This struct retains the compile-time value constant and provides a unary minus operator to obtain the negative value as a new integral_constant instance.
Definition at line 566 of file type-traits.h.
Public Member Typedefs
value_type
|
The type of the stored value.
Definition at line 514 of file type-traits.h.
Public Constructors
integral_constant()
| constexpr noexcept |
Default constructor. Initialises the base with N.
Delegates to value_base_<decltype(N)>{ N } to initialise the base.
Declaration at line 576 of file type-traits.h, definition at line 106 of file type-traits-inlines.h.
Reference micro_os_plus::micro_test_plus::type_traits::value_base_< decltype(N)>::value_base_.
Referenced by micro_os_plus::micro_test_plus::type_traits::integral_constant< N >::operator-.
Public Operators
operator decltype(N)()
| explicit nodiscard constexpr noexcept |
Explicit conversion operator to the underlying value type.
- Returns
The stored value as type T.
Allows explicit conversion to the encapsulated value.
Declaration at line 529 of file type-traits.h, definition at line 83 of file type-traits-inlines.h.
operator-()
| nodiscard constexpr noexcept |
Unary minus operator.
- Returns
An integral_constant with value -N.
Returns a new integral_constant instance representing the negative of the current value.
Declaration at line 584 of file type-traits.h, definition at line 118 of file type-traits-inlines.h.
Reference micro_os_plus::micro_test_plus::type_traits::integral_constant< N >::integral_constant.
Public Member Functions
get()
| nodiscard constexpr noexcept |
Getter for the stored value.
- Parameters
None.
- Returns
The stored value.
Returns the stored value by value.
Declaration at line 539 of file type-traits.h, definition at line 94 of file type-traits-inlines.h.
Public Member Attributes
value_
|
Public Static Attributes
value
| constexpr static |
The compile-time constant value.
Definition at line 571 of file type-traits.h.
The documentation for this struct was generated from the following files:
Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.