diff options
author | Johannes Schickel | 2008-07-29 20:21:54 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-07-29 20:21:54 +0000 |
commit | ca8a4eff265debb0aed9b038cc454be20cbe16e7 (patch) | |
tree | 137ade32aed804a8eab0ac6e155780063e821a18 | |
parent | e3a600b1d0e9bb6f3932c338f12ffa7c74fef323 (diff) | |
download | scummvm-rg350-ca8a4eff265debb0aed9b038cc454be20cbe16e7.tar.gz scummvm-rg350-ca8a4eff265debb0aed9b038cc454be20cbe16e7.tar.bz2 scummvm-rg350-ca8a4eff265debb0aed9b038cc454be20cbe16e7.zip |
- Formatting
- Improved Functor#Mem::isValid implementations.
svn-id: r33427
-rw-r--r-- | common/func.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/common/func.h b/common/func.h index 83ef9758df..1c045b9e5d 100644 --- a/common/func.h +++ b/common/func.h @@ -172,7 +172,7 @@ public: }; template<class Result, class T> -class ConstMemFunc0 : public UnaryFunction<T*, Result> { +class ConstMemFunc0 : public UnaryFunction<T *, Result> { private: Result (T::*_func)() const; public: @@ -185,7 +185,7 @@ public: }; template<class Result, class Arg, class T> -class MemFunc1 : public BinaryFunction<T*, Arg, Result> { +class MemFunc1 : public BinaryFunction<T *, Arg, Result> { private: Result (T::*_func)(Arg); public: @@ -198,7 +198,7 @@ public: }; template<class Result, class Arg, class T> -class ConstMemFunc1 : public BinaryFunction<T*, Arg, Result> { +class ConstMemFunc1 : public BinaryFunction<T *, Arg, Result> { private: Result (T::*_func)(Arg) const; public: @@ -286,7 +286,7 @@ public: Functor0Mem(T *t, const FuncType &func) : _t(t), _func(func) {} - bool isValid() const { return _func != 0; } + bool isValid() const { return _func != 0 && _t != 0; } Res operator()() const { return (_t->*_func)(); } @@ -349,7 +349,7 @@ public: Functor1Mem(T *t, const FuncType &func) : _t(t), _func(func) {} - bool isValid() const { return _func != 0; } + bool isValid() const { return _func != 0 && _t != 0; } Res operator()(Arg v1) const { return (_t->*_func)(v1); } @@ -385,7 +385,7 @@ public: Functor2Mem(T *t, const FuncType &func) : _t(t), _func(func) {} - bool isValid() const { return _func != 0; } + bool isValid() const { return _func != 0 && _t != 0; } Res operator()(Arg1 v1, Arg2 v2) const { return (_t->*_func)(v1, v2); } |