diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-09-29 22:11:43 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-09-29 22:11:43 +0000 |
| commit | b515afb729158ba2e90b82591fee0b8030281257 (patch) | |
| tree | 4f8c220e1b990bd3fc7fe3b0098ced1dcb4aa90e /lib/base | |
| parent | 5e70994aff1e028f4e67e66e9b838305c02ecf8c (diff) | |
| download | enigma2-b515afb729158ba2e90b82591fee0b8030281257.tar.gz enigma2-b515afb729158ba2e90b82591fee0b8030281257.zip | |
add operator bool() for smart pointer
Diffstat (limited to 'lib/base')
| -rw-r--r-- | lib/base/smartptr.h | 2 |
1 files changed, 2 insertions, 0 deletions
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; } }; |
