diff --git a/Borland/Functor.h b/Borland/Functor.h index 646588f..47db375 100644 --- a/Borland/Functor.h +++ b/Borland/Functor.h @@ -762,9 +762,11 @@ namespace Loki : spImpl_(new MemFunHandler(p, memFn)) {} - operator bool() + typedef impl * (std::auto_ptr::*unspecified_bool_type)() const; + + operator unspecified_bool_type() const { - return spImpl_.get() ? true : false; + return spImpl_.get() ? &std::auto_ptr::get : 0; } Functor& operator=(const Functor& rhs) diff --git a/MSVC/1300/Functor.h b/MSVC/1300/Functor.h index 18927d9..ba37f47 100644 --- a/MSVC/1300/Functor.h +++ b/MSVC/1300/Functor.h @@ -899,9 +899,11 @@ namespace Loki : spImpl_(new MemFunHandler(p, memFn)) {} - operator bool() + typedef impl * (std::auto_ptr::*unspecified_bool_type)() const; + + operator unspecified_bool_type() const { - return spImpl_.get() ? true : false; + return spImpl_.get() ? &std::auto_ptr::get : 0; } Functor& operator=(const Functor& rhs) diff --git a/Reference/Functor.h b/Reference/Functor.h index f94bccd..42fcc78 100644 --- a/Reference/Functor.h +++ b/Reference/Functor.h @@ -762,9 +762,11 @@ namespace Loki : spImpl_(new MemFunHandler(p, memFn)) {} - operator bool() + typedef impl * (std::auto_ptr::*unspecified_bool_type)() const; + + operator unspecified_bool_type() const { - return spImpl_.get() ? true : false; + return spImpl_.get() ? &std::auto_ptr::get : 0; } Functor& operator=(const Functor& rhs)