Changed functor operator bool to operator unspecified_bool_type using pointer to member function.

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@88 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
derfel 2003-01-17 01:23:08 +00:00
parent 10c21af076
commit 8b5dacc522
3 changed files with 12 additions and 6 deletions

View file

@ -762,9 +762,11 @@ namespace Loki
: spImpl_(new MemFunHandler<Functor, PtrObj, MemFn>(p, memFn))
{}
operator bool()
typedef impl * (std::auto_ptr<impl>::*unspecified_bool_type)() const;
operator unspecified_bool_type() const
{
return spImpl_.get() ? true : false;
return spImpl_.get() ? &std::auto_ptr<impl>::get : 0;
}
Functor& operator=(const Functor& rhs)

View file

@ -899,9 +899,11 @@ namespace Loki
: spImpl_(new MemFunHandler<Functor, PtrObj, MemFn>(p, memFn))
{}
operator bool()
typedef impl * (std::auto_ptr<impl>::*unspecified_bool_type)() const;
operator unspecified_bool_type() const
{
return spImpl_.get() ? true : false;
return spImpl_.get() ? &std::auto_ptr<impl>::get : 0;
}
Functor& operator=(const Functor& rhs)

View file

@ -762,9 +762,11 @@ namespace Loki
: spImpl_(new MemFunHandler<Functor, PtrObj, MemFn>(p, memFn))
{}
operator bool()
typedef impl * (std::auto_ptr<impl>::*unspecified_bool_type)() const;
operator unspecified_bool_type() const
{
return spImpl_.get() ? true : false;
return spImpl_.get() ? &std::auto_ptr<impl>::get : 0;
}
Functor& operator=(const Functor& rhs)