Skip to main content

The integral_constant Struct Template Reference

Struct template representing a generic integral constant. More...

Declaration

template <auto N> struct micro_os_plus::micro_test_plus::type_traits::integral_constant<N> { ... }

Included Headers

Base struct

structop

Empty base struct for all operator types. More...

Public Member Typedefs Index

template <auto N>
usingvalue_type = decltype(N)

The type of the constant value. More...

Public Operators Index

template <auto N>
constexproperator value_type (void) const

Explicit conversion operator to value_type. More...

template <auto N>
constexpr autooperator- () const

Unary minus operator. More...

Public Member Functions Index

template <auto N>
constexpr autoget (void) const

Getter for the constant value. More...

Public Static Attributes Index

template <auto N>
static constexpr autovalue = 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

template <auto N>
using micro_os_plus::micro_test_plus::type_traits::integral_constant< N >::value_type = decltype (N)

The type of the constant value.

Definition at line 708 of file type-traits.h.

708 using value_type = decltype (N);

Public Operators

operator value_type()

template <auto N>
micro_os_plus::micro_test_plus::type_traits::integral_constant< N >::operator value_type (void)
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.

741 operator value_type (void) const
742 {
743 return N;
744 }

operator-()

template <auto N>
auto micro_os_plus::micro_test_plus::type_traits::integral_constant< N >::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.

725 operator- () const
726 {
727 return integral_constant<-N>{};
728 }

Public Member Functions

get()

template <auto N>
auto micro_os_plus::micro_test_plus::type_traits::integral_constant< N >::get (void)
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.

757 get (void) const
758 {
759 return N;
760 }

Public Static Attributes

value

template <auto N>
auto micro_os_plus::micro_test_plus::type_traits::integral_constant< N >::value = N
constexpr static

The constant value.

Definition at line 713 of file type-traits.h.

713 static constexpr auto value = N;

The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus by Doxygen 1.14.0.