X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/2e0270746af934180499931f95ed91c444c8233e..1c0fed5449b5ab880575587803451fc58fee13eb:/lib/base/smartptr.h diff --git a/lib/base/smartptr.h b/lib/base/smartptr.h index 782ff48e..a2c6691f 100644 --- a/lib/base/smartptr.h +++ b/lib/base/smartptr.h @@ -56,12 +56,11 @@ public: #ifndef SWIG T* grabRef() { if (!ptr) return 0; ptr->AddRef(); return ptr; } - T* &ptrref() { assert(!ptr); return ptr; } + T* &ptrref() { ASSERT(!ptr); return ptr; } + operator bool() const { return !!this->ptr; } #endif T* operator->() const { ptrAssert(ptr); return ptr; } operator T*() const { return this->ptr; } - - operator bool() const { return !!this->ptr; } }; @@ -135,7 +134,7 @@ public: #ifndef SWIG T* grabRef() { if (!ptr) return 0; ptr->AddRef(); ptr->AddUse(); return ptr; } - T* &ptrref() { assert(!ptr); return ptr; } + T* &ptrref() { ASSERT(!ptr); return ptr; } #endif T* operator->() const { ptrAssert(ptr); return ptr; } operator T*() const { return this->ptr; }