|
micro-test-plus 4.1.0
µTest++ Testing Framework
|
Operator struct template to check if an expression does not throw any exception. More...
#include <micro-os-plus/micro-test-plus.h>
Public Member Functions | |
| constexpr | nothrow_ (const Callable_T &func) |
| Constructs a nothrow checking operator for the given callable. | |
| constexpr | operator bool () const |
| Conversion operator to boolean. | |
Private Attributes | |
| const bool | value_ {} |
| Stores the result of the callable invocation. | |
This struct checks whether invoking the given callable completes without throwing an exception. 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 is exception-safe.
| Callable_T | The type of the callable object to be invoked. |
|
explicitconstexpr |
| func | The callable object to be invoked. |
Invokes func inside a try/catch block. If func completes without throwing, the result is true; if any exception is thrown the result is false. The result is passed to the callable_op_ base class constructor.
Definition at line 608 of file detail-inlines.h.
References micro_os_plus::micro_test_plus::detail::callable_op_::callable_op_(), and nothrow_().
Referenced by nothrow_().
|
nodiscardconstexprinherited |
Returns the pre-computed boolean result stored by the derived operator's constructor.
Definition at line 534 of file detail-inlines.h.
References value_.
|
privateinherited |