]>
git.saurik.com Git - apple/xnu.git/blob - tests/intrusive_shared_ptr_src/operator.bool.cpp
3 // explicit constexpr operator bool() const noexcept;
6 #include <libkern/c++/intrusive_shared_ptr.h>
8 #include <darwintest.h>
9 #include "test_policy.h"
22 test_shared_ptr
<T
> const ptr(&obj
, libkern::no_retain
);
23 CHECK(static_cast<bool>(ptr
));
31 test_shared_ptr
<T
> const ptr
= nullptr;
32 CHECK(!static_cast<bool>(ptr
));
39 static_assert(!std::is_convertible_v
<test_shared_ptr
<T
>, bool>);
42 T_DECL(operator_bool
, "intrusive_shared_ptr.operator.bool") {