title: Setting function pointer in class constructor... '&' : illegal operation on bound member function expression
body: <p>I am trying to set a function pointer on the constructor of a class.</p>
  
  <p>I am receiving the following error:</p>
  
  <p>Error   1   error C2276: '&amp;' : illegal operation on bound member function expression</p>
  
  <p>Can anyone please advise why this is happening (code below)?</p>
  
  <p>Edit:</p>
  
  <p>This example of the problem better shows my situation. I am ONLY able to change MyClass. I cannot touch MyBase or it's contents.</p>
  
  <p><code></p>
  
  <pre><code>class MyBase
  {
  public:
  
      void (*MyFunctionPointer)(int args);
  
  };
  
  class MyClass : public MyBase
  {
  public:
  
      void MyFunction(int args)
      {
      }
  
      MyClass()
      {
          MyFunctionPointer = &amp;MyFunction;
      }
  };
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      MyClass temp;
  
      return 0;
  }
  </code></pre>
  
  <p></code></p>