From 7d1a8517027d0a14dfb4c6b2d382466414d96bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Canberk=20S=C3=B6nmez?= Date: Fri, 29 Sep 2023 14:54:36 +0200 Subject: [PATCH] reference_counted comparison with nullptr_t --- include/cxxdes/misc/reference_counted.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/cxxdes/misc/reference_counted.hpp b/include/cxxdes/misc/reference_counted.hpp index 6b56161..492f7d7 100644 --- a/include/cxxdes/misc/reference_counted.hpp +++ b/include/cxxdes/misc/reference_counted.hpp @@ -124,6 +124,10 @@ struct ptr { return valid(); } + bool operator==(std::nullptr_t) { + return !valid(); + } + T *get() noexcept { return ptr_; }