// // Tests for // T& operator*() const noexcept; // T* operator->() const noexcept; // #include #include #include "test_policy.h" struct T { int i; }; template static void tests() { T obj{3}; tracked_shared_ptr ptr(&obj, libkern::no_retain); { T& ref = *ptr; CHECK(&ref == &obj); CHECK(ref.i == 3); } { int const& ref = ptr->i; CHECK(&ref == &obj.i); CHECK(ref == 3); } } T_DECL(deref, "intrusive_shared_ptr.deref", T_META_TAG_VM_PREFERRED) { tests(); tests(); }