]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Define RefCount nullptr assignment operator (#1459)
authorAmos Jeffries <yadij@users.noreply.github.com>
Fri, 18 Aug 2023 00:39:36 +0000 (00:39 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 19 Aug 2023 11:51:15 +0000 (11:51 +0000)
If RefCount(C*) constructor becomes private, this change
will be needed to use 'foo=nullptr' syntax to clear a Pointer.

src/base/RefCount.h

index 60d8c2093c7fec44b3a45330aedb322eb0a8da00..782b9b52da4584ad37aa499acd1db9f519417d7d 100644 (file)
@@ -66,6 +66,8 @@ public:
         return *this;
     }
 
+    RefCount &operator =(std::nullptr_t) { dereference(); return *this; }
+
     explicit operator bool() const { return p_; }
 
     bool operator !() const { return !p_; }