throws_ Struct Template
Operator struct template to check if an expression throws any exception. More...
Declaration
struct micro_os_plus::micro_test_plus::detail::throws_<Callable_T, void> { ... }
Included Headers
Base struct
| struct | callable_op_ |
|
Common base struct for callable-wrapping operators. More... | |
Public Constructors Index
template <class Callable_T> | |
| constexpr | throws_ (const Callable_T &func) |
|
Constructs an exception checking operator for the given callable. More... | |
Public Operators Index
template <class Callable_T> | |
| constexpr | operator bool () const |
|
Conversion operator to boolean. More... | |
Private Member Attributes Index
template <class Callable_T> | |
| const bool | value_ |
|
Stores the result of the callable invocation. More... | |
Description
Operator struct template to check if an expression throws any exception.
This partial specialisation checks whether invoking the given callable throws any exception, regardless of type. The check is performed at construction time, with the result cached for reporting and composition. Use this when a test must verify that an operation raises an exception without caring about the specific exception type.
- Template Parameters
-
Callable_T The type of the callable object to be invoked.
Definition at line 673 of file detail.h.
Public Constructors
throws_()
| explicit constexpr |
Constructs an exception checking operator for the given callable.
- Parameters
-
func The callable object to be invoked.
Invokes func inside a try/catch block. If func throws any exception the result is true; if no exception is thrown the result is false. The result is passed to the callable_op_ base class constructor.
Declaration at line 681 of file detail.h, definition at line 582 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::callable_op_::callable_op_ and micro_os_plus::micro_test_plus::detail::throws_< Callable_T, Exception_T >::throws_.
Public Operators
operator bool()
| nodiscard constexpr |
Conversion operator to boolean.
- Parameters
None.
- Returns
The result of the callable invocation.
Returns the pre-computed boolean result stored by the derived operator's constructor.
Declaration at line 615 of file detail.h, definition at line 535 of file detail-inlines.h.
The documentation for this struct was generated from the following files:
Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.