]>
git.saurik.com Git - apple/xnu.git/blob - tests/safe_allocation_src/operator.bool.cpp
3 // explicit operator bool() const;
6 #include <libkern/c++/safe_allocation.h>
7 #include <darwintest.h>
8 #include "test_utils.h"
20 test_safe_allocation
<T
> const array(10, libkern::allocate_memory
);
21 CHECK(static_cast<bool>(array
));
28 test_safe_allocation
<T
> const array
= nullptr;
29 CHECK(!static_cast<bool>(array
));
36 static_assert(!std::is_convertible_v
<test_safe_allocation
<T
>, bool>);
39 T_DECL(operator_bool
, "safe_allocation.operator.bool") {