|
micro-test-plus 6.0.0
µTest++ Testing Framework
|
Concept satisfied when T is a callable object that returns a printable message. More...
#include <extension.h>
| T | The type to be checked. |
The lazy_message concept is satisfied when T is a class type, such as a lambda or a std::function, callable without arguments as a const object, whose result is not void and satisfies extension::printable. The message operator of the checks calls such an object only when the check fails, and appends its result, so that a message that is valid only after a failure (the error of a std::expected, for example) is not evaluated after a success.
The function pointers are excluded, since they are printable (as addresses), and calling them by mistake could have side effects; a lambda without captures, which converts to a function pointer and then to bool, is printable too, and is called, since it is a class type.
Definition at line 693 of file extension.h.