(Simple?) pointer to non-static member function question
<p>See the code below - I want to know how to, or if it is even possible to, write the body of A::DoThisOrThat()</p>

<pre><code>class A
{
  void DoThis( void ) { // any function body you like... }
  void DoThat( void ) { // any function body you like... }

  void DoThisOrThat( const bool doThis );
};

void A::DoThisOrThat( const bool doThis )
{
    void (*pMemberFunction)( void );
    pMemberFunction = doThis? &amp;A::DoThis : &amp;A::DoThat;

    (*pMemberFunction)();    // member function invoked controlled by parameter
}
</code></pre>

<p>All three lines of this function may need rewriting to correctly scope the member function. As written, I get a calling convention conflict on the second line where I assign pMemberFunction. I cannot lay my hands on a simple example clarifying this - all the examples easily found declare a member variable to hold the member function pointer. Can I not just create a local variable to do the same?</p>
