Make FbTk::MemFun[12] inherit from std::unary/binary_function

this way, they can be used as inputs to std::bind1st and friends
This commit is contained in:
Pavel Labath 2011-05-05 15:38:42 +02:00
parent 2024f258b6
commit 6cfa087536

View file

@ -22,6 +22,7 @@
#ifndef FBTK_MEM_FUN_HH #ifndef FBTK_MEM_FUN_HH
#define FBTK_MEM_FUN_HH #define FBTK_MEM_FUN_HH
#include <functional>
#include "SelectArg.hh" #include "SelectArg.hh"
namespace FbTk { namespace FbTk {
@ -55,7 +56,7 @@ MemFun( Object& obj, ReturnType (Object:: *action)() ) {
/// One argument functor /// One argument functor
template <typename ReturnType, typename Object, typename Arg1> template <typename ReturnType, typename Object, typename Arg1>
class MemFun1 { class MemFun1: public std::unary_function<Arg1, ReturnType> {
public: public:
typedef ReturnType (Object:: *Action)(Arg1); typedef ReturnType (Object:: *Action)(Arg1);
@ -82,7 +83,7 @@ MemFun( Object& obj, ReturnType (Object:: *action)(Arg1) ) {
/// Two argument functor /// Two argument functor
template <typename ReturnType, typename Object, typename Arg1, typename Arg2> template <typename ReturnType, typename Object, typename Arg1, typename Arg2>
class MemFun2 { class MemFun2: public std::binary_function<Arg1, Arg2, ReturnType> {
public: public:
typedef ReturnType (Object:: *Action)(Arg1,Arg2); typedef ReturnType (Object:: *Action)(Arg1,Arg2);