48#ifndef MICRO_OS_PLUS_MICRO_TEST_PLUS_TYPE_TRAITS_H_
49#define MICRO_OS_PLUS_MICRO_TEST_PLUS_TYPE_TRAITS_H_
53#if defined(__cplusplus)
57#if __has_include("micro-os-plus/project-config.h")
58#include "micro-os-plus/project-config.h"
61#if __has_include("micro-os-plus/micro-test-plus-defines.h")
62#include "micro-os-plus/micro-test-plus-defines.h"
73#pragma GCC diagnostic push
76#pragma clang diagnostic ignored "-Wc++98-compat"
77#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
131 template <
class... Types>
157 template <
class T,
class... Extra>
166#if defined(__DOXYGEN__)
194 struct function_traits : function_traits<decltype (&T::operator())>
218 template <
class R,
class... Args_T>
219 struct function_traits<R (*) (Args_T...)>
251 template <
class R,
class... Args_T>
252 struct function_traits<R (Args_T...)>
285 template <
class R,
class T,
class... Args_T>
286 struct function_traits<R (T::*) (Args_T...)>
320 template <
class R,
class T,
class... Args_T>
321 struct function_traits<R (T::*) (Args_T...) const>
446 concept is_op = std::is_base_of_v<type_traits::op, T>;
462 template <
class Lhs_T,
class Rhs_T>
496 or std::is_convertible_v<T, std::string_view>;
530 constexpr explicit value_base_ (
const T& v)
noexcept;
537 [[nodiscard]]
constexpr explicit
538 operator T () const noexcept;
547 [[nodiscard]] constexpr T
548 get (
void) const noexcept;
592 [[nodiscard]] constexpr auto
593 operator- () const noexcept;
624 template <class T, auto N, auto D, auto Size, auto P = 1>
627 static_assert (P == 1 || P == -1,
628 "floating_point_constant: P must be +1 or -1");
650 = T (P) * (T (N) + (T (D) /
math::pow (T (10), Size)));
657 [[nodiscard]]
constexpr explicit
658 operator T () const noexcept;
667 [[nodiscard]] constexpr T
668 get (
void) const noexcept;
675 [[nodiscard]] constexpr auto
676 operator- () const noexcept;
726 constexpr value (
const T& _value)
noexcept;
786 constexpr value (
const T& _value,
const T precision) noexcept
804 math::den_size<unsigned long long> (val)) }
816#pragma GCC diagnostic pop
C++20 concept satisfied when at least one of two types derives from op.
C++20 concept satisfied when a type can be used as a test expression in expect() or assume().
C++20 concept satisfied when T provides both begin() and end() member functions.
C++20 concept satisfied when T provides an epsilon member.
C++20 concept satisfied when T provides a npos member.
C++20 concept satisfied when T provides a value member.
C++20 concept satisfied when T is a standard floating point type.
C++20 concept satisfied when a type derives from op.
C++20 concept satisfied when a type can be appended to the deferred reporter's output via operator<<.
C++ header file with declarations for the µTest++ mathematical utilities.
Mathematical utilities for the µTest++ testing framework.
constexpr auto pow(const T base, const Exp_T exp) noexcept -> T
Generic exponentiation function to compute the power of a base raised to an exponent.
Type trait utilities and metaprogramming support for the µTest++ testing framework.
Primary namespace for the µTest++ testing framework.
Struct template representing a generic floating point constant with custom size and precision.
T value_type
The type of the stored value.
static constexpr auto epsilon
The epsilon value used for floating point comparisons.
constexpr T get(void) const noexcept
Getter for the compile-time constant value.
static constexpr auto value
The compile-time constant value.
R result_type
The return type of the function.
list< Args_T... > args
Type list of all argument types.
R result_type
The return type of the member function.
list< Args_T... > args
Type list of all argument types.
R result_type
The return type of the const member function.
list< Args_T... > args
Type list of all argument types.
list< Args_T... > args
Type list of all argument types.
R result_type
The return type of the function.
constexpr genuine_integral_value(const T &_value) noexcept
Constructs a genuine_integral_value with the specified value.
Struct template for compile-time type identity.
T type
Alias for the preserved type.
static constexpr auto value
The compile-time constant value.
constexpr integral_constant() noexcept
Default constructor. Initialises the base with N.
Struct template representing a compile-time type list.
Empty base struct for all operator types.
T epsilon
The epsilon value used for floating-point comparisons.
constexpr value(const T &val)
Constructs a floating point value with default precision.
constexpr value(const T &_value, const T precision) noexcept
Constructs a floating-point value with a specified precision.
T value_type
The type of the stored value.
T value_
The stored value.
constexpr value_base_(const T &v) noexcept
Constructs a value_base_ with the given value.
constexpr T get(void) const noexcept
Getter for the stored value.
constexpr value(const T &_value) noexcept
Constructs a value object with the specified value.
C++ header file with inline implementations for the µTest++ type trait utilities.