title: Passing a member function as an argument to a constructor
body: <p>I have a button class. I want the button class's constructor to take the function it will call when the button is pressed. This would be easy if the button class was only taking a function from one class, but the purpose of the button's constructor taking a function is that no matter what class the button is created in it will be able to store a pointer to a function in the class it's created in.</p>
  
  <p>To illustrate:</p>
  
  <pre><code>struct Button {
      Button(void (*functionPtr)()) {
          // Store the function pointer to be called later
      }
  };
  
  struct SomeClass {
      void LoadFile();
  
      SomeClass() {
          Button* temp1 = new Button(&amp;LoadFile); // ???
      }
  };
  
  struct AnotherClass {
      void SaveFile();
  
      SomeClass() {
          Button* temp2 = new Button(&amp;SaveFile); // ???
      }
  };
  </code></pre>
  
  <p>How can I make that work?</p>