Pass the class member function as an argument to the class member function


Have a code from standard library

//snippet from a standard library module Expert\Signal\SignalMA.mqh with additional Compare() and LongCondition()

class CSignalAMA : public CExpertSignal
   CiAMA             m_ma;  

   double            MA(int ind)                         { return(m_ma.Main(ind));     }
   double            DiffMA(int ind)                     { return(MA(ind)-MA(ind+1));  }

   bool              Compare(function_pointer0, function_pointer1, int bars=3);         //class member function that uses other class member functions. Agruments are obviously pseudocode
   void              LongCondition();


bool CSignalAMA::Compare(function_pointer0, function_pointer1, int bars=3)              //function body is written just an example what could be inside
    int result 0;
    for(int i=0,i<bars;i++)
        if((function_pointer0(i)<function_pointer0(i+1)) &&

    if(result == 0){return true;}
    else           {return false;}


void CSignal::LongCondition()
    if (Compare(MA, DiffMA))
        //do smth

My goal is to pass the class member functions as a parameter to other class member function that's called in another class member functions with the least changes in standard module possible.
And keeping readibility if possible
 Compare(MA, DiffMA)
 - is pretty obvious what's going on here

while in
Compare(var1, var2)
 - it is not

Also the class should not be instanciated in the code - in standard library it is created in different place and different time.

Thank you!


I've seen the example with typedef and global functions  but it looks like it's NOT working with class member functions.  

typedef int (*TFunc)(int, int);

int multiply(int x, int y);
int doWork(TFunc callback);
void OnStart();


int MyClass::multiply(int x, int y) {
   return x * y;

int MyClass::doWork(TFunc callback) {
   return callback(3, 3);

void MyClass::OnStart(){

I get **pointer to this function type is not supported yet** compilation error.