X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e39c12fcbf218f0964782a48d6e66145e1ce5039..9925392e576717cc0df070ace822a6f392808bb7:/lib/base/smartptr.h diff --git a/lib/base/smartptr.h b/lib/base/smartptr.h index 7e441ab2..814d7457 100644 --- a/lib/base/smartptr.h +++ b/lib/base/smartptr.h @@ -3,14 +3,7 @@ #include "object.h" #include - -#ifdef SWIG -#define TEMPLATE_TYPEDEF(x, y) \ -%template(y) x; \ -typedef x y -#else -#define TEMPLATE_TYPEDEF(x, y) typedef x y -#endif +#include template class ePtr @@ -63,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; } };