diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-05-05 13:38:42 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-05-10 11:00:45 (GMT) |
commit | 6cfa087536abf3328cabbe867df978309034edc9 (patch) | |
tree | 54a82fe75fd11420ea4dc74d1b833a79ed5658d0 /src/FbTk | |
parent | 2024f258b66ead778b7c5e048e29967cfe7e8bf2 (diff) | |
download | fluxbox_pavel-6cfa087536abf3328cabbe867df978309034edc9.zip fluxbox_pavel-6cfa087536abf3328cabbe867df978309034edc9.tar.bz2 |
Make FbTk::MemFun[12] inherit from std::unary/binary_function
this way, they can be used as inputs to std::bind1st and friends
Diffstat (limited to 'src/FbTk')
-rw-r--r-- | src/FbTk/MemFun.hh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/FbTk/MemFun.hh b/src/FbTk/MemFun.hh index d19bb08..63f922e 100644 --- a/src/FbTk/MemFun.hh +++ b/src/FbTk/MemFun.hh | |||
@@ -22,6 +22,7 @@ | |||
22 | #ifndef FBTK_MEM_FUN_HH | 22 | #ifndef FBTK_MEM_FUN_HH |
23 | #define FBTK_MEM_FUN_HH | 23 | #define FBTK_MEM_FUN_HH |
24 | 24 | ||
25 | #include <functional> | ||
25 | #include "SelectArg.hh" | 26 | #include "SelectArg.hh" |
26 | 27 | ||
27 | namespace FbTk { | 28 | namespace FbTk { |
@@ -55,7 +56,7 @@ MemFun( Object& obj, ReturnType (Object:: *action)() ) { | |||
55 | 56 | ||
56 | /// One argument functor | 57 | /// One argument functor |
57 | template <typename ReturnType, typename Object, typename Arg1> | 58 | template <typename ReturnType, typename Object, typename Arg1> |
58 | class MemFun1 { | 59 | class MemFun1: public std::unary_function<Arg1, ReturnType> { |
59 | public: | 60 | public: |
60 | typedef ReturnType (Object:: *Action)(Arg1); | 61 | typedef ReturnType (Object:: *Action)(Arg1); |
61 | 62 | ||
@@ -82,7 +83,7 @@ MemFun( Object& obj, ReturnType (Object:: *action)(Arg1) ) { | |||
82 | 83 | ||
83 | /// Two argument functor | 84 | /// Two argument functor |
84 | template <typename ReturnType, typename Object, typename Arg1, typename Arg2> | 85 | template <typename ReturnType, typename Object, typename Arg1, typename Arg2> |
85 | class MemFun2 { | 86 | class MemFun2: public std::binary_function<Arg1, Arg2, ReturnType> { |
86 | public: | 87 | public: |
87 | typedef ReturnType (Object:: *Action)(Arg1,Arg2); | 88 | typedef ReturnType (Object:: *Action)(Arg1,Arg2); |
88 | 89 | ||