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:
parent
10c21af076
commit
8b5dacc522
3 changed files with 12 additions and 6 deletions
|
@ -762,9 +762,11 @@ namespace Loki
|
||||||
: spImpl_(new MemFunHandler<Functor, PtrObj, MemFn>(p, memFn))
|
: 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)
|
Functor& operator=(const Functor& rhs)
|
||||||
|
|
|
@ -899,9 +899,11 @@ namespace Loki
|
||||||
: spImpl_(new MemFunHandler<Functor, PtrObj, MemFn>(p, memFn))
|
: 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)
|
Functor& operator=(const Functor& rhs)
|
||||||
|
|
|
@ -762,9 +762,11 @@ namespace Loki
|
||||||
: spImpl_(new MemFunHandler<Functor, PtrObj, MemFn>(p, memFn))
|
: 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)
|
Functor& operator=(const Functor& rhs)
|
||||||
|
|
Loading…
Reference in a new issue