title: C++ Call Pointer To Member Function
body: <p>I have a list of pointers to member functions but I am having a difficult time trying to call those functions... whats the proper syntax?</p>
  
  <pre><code>typedef void (Box::*HitTest) (int x, int y, int w, int h);
  
  for (std::list&lt;HitTest&gt;::const_iterator i = hitTestList.begin(); i != hitTestList.end(); ++i)
  {
      HitTest h = *i;
      (*h)(xPos, yPos, width, height);
  }
  </code></pre>
  
  <p>Also im trying to add member functions to it here</p>
  
  <pre><code>std::list&lt;HitTest&gt; list;
  
  for (std::list&lt;Box*&gt;::const_iterator i = boxList.begin(); i != boxList.end(); ++i)
  {
      Box * box = *i;
      list.push_back(&amp;box-&gt;HitTest);
  }
  </code></pre>