From b515afb729158ba2e90b82591fee0b8030281257 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Thu, 29 Sep 2005 22:11:43 +0000 Subject: [PATCH] add operator bool() for smart pointer --- lib/base/smartptr.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/base/smartptr.h b/lib/base/smartptr.h index f9d224b0..814d7457 100644 --- a/lib/base/smartptr.h +++ b/lib/base/smartptr.h @@ -56,6 +56,8 @@ public: T* &ptrref() { assert(!ptr); return ptr; } T* operator->() const { assert(ptr); return ptr; } operator T*() const { return this->ptr; } + + operator bool() const { return !!this->ptr; } }; -- 2.30.2