translations
[enigma2.git] / lib / base / smartptr.h
index 7e441ab2976ab67e48e67b89064a72c22fe9ec7f..814d7457e29eafaa0420012b7cb53fbb6c93c40c 100644 (file)
@@ -3,14 +3,7 @@
 
 #include "object.h"
 #include <stdio.h>
-
-#ifdef SWIG
-#define TEMPLATE_TYPEDEF(x, y) \
-%template(y) x; \
-typedef x y
-#else
-#define TEMPLATE_TYPEDEF(x, y) typedef x y
-#endif
+#include <lib/python/swig.h>
 
 template<class T>
 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; }
 };