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

 
Hi,

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
{
protected:
   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)) &&
           (function_pointer1(i)<function_pointer1(i+1))){}
        else
           {result++;
            break;}
    }    

    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
In   
 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!


p.s.

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

MyClass{
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(){
   Print(doWork(multiply));
 
}

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