X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=ETL%2Ftrunk%2FETL%2F_handle.h;h=317f6c2bde27807dd1cdcc67a16bd8caf95c72ea;hb=117425a5858bb094f2e54af5d018499ab703b227;hp=0cf5af2854d39121098831818d7e5001ec919431;hpb=b3016b249333ac0ab0008d8c6c4d9029b2ff30c9;p=synfig.git diff --git a/ETL/trunk/ETL/_handle.h b/ETL/trunk/ETL/_handle.h index 0cf5af2..317f6c2 100644 --- a/ETL/trunk/ETL/_handle.h +++ b/ETL/trunk/ETL/_handle.h @@ -257,14 +257,14 @@ public: operator->()const { assert(obj); return obj; } - //! static_cast<> overload -- Useful for implicit casts - template - operator handle()const - { return handle(static_cast(obj)); } + //! More explicit bool cast + operator bool()const + { return obj!=NULL; } operator handle()const { return handle(static_cast(obj)); } + //! static_cast\<\> wrapper template static handle cast_static(const handle &x) @@ -303,13 +303,14 @@ public: //! Returns pointer to the object that is being wrapped pointer get()const { return obj; } - //! More explicit bool cast - operator bool()const - { return obj!=NULL; } - bool operator!()const { return !obj; } + + //! static_cast<> overload -- Useful for implicit casts + template + operator handle()const + { return handle(static_cast(obj)); } }; // END of template class handle // ========================================================================