From ca8a4eff265debb0aed9b038cc454be20cbe16e7 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 29 Jul 2008 20:21:54 +0000 Subject: - Formatting - Improved Functor#Mem::isValid implementations. svn-id: r33427 --- common/func.h | 12 ++++++------ 1 file 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 ConstMemFunc0 : public UnaryFunction { +class ConstMemFunc0 : public UnaryFunction { private: Result (T::*_func)() const; public: @@ -185,7 +185,7 @@ public: }; template -class MemFunc1 : public BinaryFunction { +class MemFunc1 : public BinaryFunction { private: Result (T::*_func)(Arg); public: @@ -198,7 +198,7 @@ public: }; template -class ConstMemFunc1 : public BinaryFunction { +class ConstMemFunc1 : public BinaryFunction { 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); } -- cgit v1.2.3