From 5b242f69001f884bf1d88986b218a80e270b400e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20Dee=20=28J=C5=8Dshin=29?= Date: Sat, 15 Jun 2024 17:53:31 -0700 Subject: [PATCH] Consistently use operator bool --- ctl/unique_ptr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctl/unique_ptr.h b/ctl/unique_ptr.h index a1c83cbf4..b2853278e 100644 --- a/ctl/unique_ptr.h +++ b/ctl/unique_ptr.h @@ -69,7 +69,7 @@ struct unique_ptr inline void reset(nullptr_t = nullptr) noexcept { - if (d.first()) + if (*this) d.second()(d.first()); d.first() = nullptr; } @@ -79,7 +79,7 @@ struct unique_ptr /* requires is_convertible_v */ inline void reset(U* p2) { - if (d.first()) { + if (*this) { d.second()(d.first()); } d.first() = static_cast(p2);