From: ghost Date: Fri, 8 May 2009 12:14:38 +0000 (+0200) Subject: swig 1.3.39 wraps also operator bool.. we dont like this yet... X-Git-Tag: 2.6.0~320^2~1 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/53308f5235c4c6cc0eb263709ff0336a86207882?ds=sidebyside swig 1.3.39 wraps also operator bool.. we dont like this yet... --- diff --git a/lib/base/smartptr.h b/lib/base/smartptr.h index ac6b9eb0..a2c6691f 100644 --- a/lib/base/smartptr.h +++ b/lib/base/smartptr.h @@ -57,11 +57,10 @@ public: #ifndef SWIG T* grabRef() { if (!ptr) return 0; ptr->AddRef(); 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; } }; diff --git a/lib/service/iservice.h b/lib/service/iservice.h index 8e3cec6f..22ffde6f 100644 --- a/lib/service/iservice.h +++ b/lib/service/iservice.h @@ -138,6 +138,10 @@ public: data[3]=data3; data[4]=data4; } + operator bool() const + { + return valid(); + } #endif eServiceReference(int type, int flags, const std::string &path) : type(type), flags(flags), path(path) @@ -170,10 +174,6 @@ public: return r < 0; return path < c.path; } - operator bool() const - { - return valid(); - } int valid() const {