dimanche 26 avril 2015

How can I use a function as argument to a member function using std::bind?

I am trying to use the member function Sover::tov as an argument to another function using std::bind. I get a compile error at calling std::bind. Briefly, the essence of my code is the following. What is wrong with my syntax?

class Solver {
   private:
      ....
   public:
    ....
       double solve(vector< vector<double> > & sol, const double &z, const double &n) 
        {...
            method(std::bind(&Solver::tov, *this, pl::_1 , pl::_2 , pl::_3 ),y,x,dx)
         ...}
        void tov ( const vector<double> &y, vector<double> &dy, const double &x ) {...}
   };     
void method(void (*i_function)(const vector< double > &, vector<double> &, const double &), vector< double > &y, const double &x, const double &h) {...}

Aucun commentaire:

Enregistrer un commentaire