resolve some further uses implicit bool conversion trickery (closes #178)

This commit is contained in:
Fischlurch 2017-04-02 06:49:05 +02:00
parent afe07bdb16
commit 0446f49e7d
2 changed files with 3 additions and 10 deletions

View file

@ -180,8 +180,6 @@ namespace lumiera {
I* instance_;
facade::Link<I,FA> facadeLink_;
typedef InstanceHandle<I,FA> _ThisType;
public:
/** Set up an InstanceHandle representing a plugin.
* Should be placed at the client side.
@ -231,13 +229,8 @@ namespace lumiera {
typedef I* _ThisType::*unspecified_bool_type;
/** implicit conversion to "bool" */
operator unspecified_bool_type() const // never throws
{ return isValid()? &_ThisType::instance_ : 0; }
bool operator! () const { return not isValid(); }
explicit operator bool() const { return isValid(); }
bool operator! () const { return not isValid();}
private:

View file

@ -395,8 +395,8 @@ namespace wrapper {
Res& operator*() const { return *lastResult_; }
bool isValid () const { return lastResult_.isValid(); }
explicit
operator bool() const { return isValid(); }
// can't use lib::BoolCheckable, because tr1::function implements safe-bool too
};