|
micro-test-plus 6.0.0
µTest++ Testing Framework
|
Concept satisfied by the wrappers of a bool, whose condition is ambiguous. More...
#include <extension.h>
The condition of a std::optional<bool>, or of a smart pointer to a bool, tests the wrapper (a value is present, or the pointer is not null), not the bool that it holds, which is what a reader of t.expect (flag) assumes; a check with false inside would pass, and be reported as true, for another reason than the one the author had in mind, as the checks of the arguments that are always true (see suspicious_condition). A check that passes silently by mistake is worse than one that does not compile, so extension::checkable rejects these types, and the application writes has_value(), != nullptr, or compares the value with eq(). The wrappers of the other types are accepted, since the presence of a value is then the only meaning of the condition.
| T | The type to check. |
Definition at line 216 of file extension.h.