Skip to main content

The throws_ Struct Template Reference

Operator struct template to check if an expression throws any exception. More...

Declaration

template <class Callable_T>
struct micro_os_plus::micro_test_plus::detail::throws_<Callable_T, void>

Included Headers

Public Constructors Index

template <class Callable_T>
constexprthrows_ (const Callable_T &func)

Constructs an exception checking operator for the given callable. More...

Public Operators Index

template <class Callable_T>
constexproperator bool () const

Conversion operator to boolean. More...

Public Member Attributes Index

template <class Callable_T>
const boolvalue_ {}

Stores the result of the exception check. More...

Description

Operator struct template to check if an expression throws any exception.

Template Parameters
Callable_TThe type of the callable object to be invoked.

The throws_ struct template provides a type-safe mechanism for verifying whether a callable expression throws any exception during its execution within the framework.

This comparator is designed to support both custom and standard callable types. The result of the exception check is stored in the value_ member for efficient access.

The implementation is optimised for use in embedded environments and supports both compile-time and run-time evaluation.

All definitions are intended for internal use within the framework and are implemented in the include/micro-os-plus/micro-test-plus folder to maintain a structured and modular codebase.

Definition at line 1594 of file detail.h.

Public Constructors

throws_()

template <class Callable_T>
micro_os_plus::micro_test_plus::detail::throws_< Callable_T, void >::throws_ (const Callable_T & func)
inlineexplicitconstexpr

Constructs an exception checking operator for the given callable.

Invokes the provided callable and determines whether it throws any exception. The result is stored in the value_ member for efficient access.

Parameters
funcThe callable object to be invoked.

Definition at line 1607 of file detail.h.

Public Operators

operator bool()

template <class Callable_T>
micro_os_plus::micro_test_plus::detail::throws_< Callable_T, void >::operator bool () const
inlinenodiscardconstexpr

Conversion operator to boolean.

Parameters

None.

Return Values
trueThe callable throws an exception.

Returns the result of the exception check.

Return Values
falseThe callable does not throw any exception.

Definition at line 1634 of file detail.h.

Public Member Attributes

value_

template <class Callable_T>
const bool micro_os_plus::micro_test_plus::detail::throws_< Callable_T, void >::value_ {}

Stores the result of the exception check.

Definition at line 1642 of file detail.h.


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


Generated via docusaurus-plugin-doxygen by Doxygen 1.14.0.