title: Can a single function pointer point to multiple classes member function
body: <p>Here are the requirements posed by my application. I have a class A, that accepts a function pointer say cFunc, Basically in my implementation of A, I have it call cFunc multiple times.</p>
  
  <p>The cFunc pointer itself should point to different functions depending upon the application. Thus for each application I create a class with the same function definition as cFunc, however I cannot assign the class's member function to this pointer</p>
  
  <pre><code>class A {
      typedef double (*Def_CFunc)(std::vector&lt;double&gt;);
      A(Def_CFunc _cFunc) { // Some implementation}
      // Other Functions
  };
  
  class B { double someFunc(std::vector&lt;double&gt; b); };
  class C { double someOtherFunc(std::vector&lt;double&gt; a); };
  
  int main () {
      B firstObj;
      C secondObj;
  
      // Depending upon the situation, I want to select class B or C
      double (*funcPointer)(std::vector&lt;double&gt;) = firstObj.someFunc; // Error in this line of code
  
      A finalObj(funcPointer);
  }
  </code></pre>
  
  <p>So how do I make it such that any class with a member function of the given format can be used to initialize the class A?</p>