resolve some further uses implicit bool conversion trickery (closes #178)
This commit is contained in:
parent
afe07bdb16
commit
0446f49e7d
2 changed files with 3 additions and 10 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue