48#ifndef MICRO_TEST_PLUS_TYPE_TRAITS_H_
49#define MICRO_TEST_PLUS_TYPE_TRAITS_H_
65#pragma GCC diagnostic push
67#pragma clang diagnostic ignored "-Wc++98-compat"
68#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
122 template <
class... Types>
148 template <
class T,
class... Extra>
157#if defined(__DOXYGEN__)
185 struct function_traits : function_traits<decltype (&T::operator())>
209 template <
class R,
class... Args_T>
210 struct function_traits<R (*) (Args_T...)>
242 template <
class R,
class... Args_T>
243 struct function_traits<R (Args_T...)>
276 template <
class R,
class T,
class... Args_T>
277 struct function_traits<R (T::*) (Args_T...)>
311 template <
class R,
class T,
class... Args_T>
312 struct function_traits<R (T::*) (Args_T...) const>
437 concept is_op = std::is_base_of_v<type_traits::op, T>;
453 template <
class Lhs_T,
class Rhs_T>
487 or std::is_convertible_v<T, std::string_view>;
521 constexpr explicit value_base_ (
const T& v)
noexcept;
528 [[nodiscard]]
constexpr explicit
529 operator T () const noexcept;
538 [[nodiscard]] constexpr T
539 get (
void) const noexcept;
583 [[nodiscard]] constexpr auto
584 operator- () const noexcept;
615 template <class T, auto N, auto D, auto Size, auto P = 1>
618 static_assert (P == 1 || P == -1,
619 "floating_point_constant: P must be +1 or -1");
641 = T (P) * (T (N) + (T (D) /
math::pow (T (10), Size)));
648 [[nodiscard]]
constexpr explicit
649 operator T () const noexcept;
658 [[nodiscard]] constexpr T
659 get (
void) const noexcept;
666 [[nodiscard]] constexpr auto
667 operator- () const noexcept;
714 constexpr value (
const T& _value)
noexcept;
761 constexpr value (
const T& _value,
const T precision)
noexcept;
768 constexpr value (
const T& val);
778#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.
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.
list< Args_T... > args
Type list of all argument types.
R result_type
The return type of the function.
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 const member 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.
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 &_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.