title: Pass non-static member function as a callback
body: <p>I found several similar questions, but the solutions didn't suit my case.
  In a C++ method, I call a C api, which takes a callback as one of its parameter.</p>
  
  <pre><code>class A
  {
  
     herr_t methodA(some parameters) {....}
  
     void methodB(some parameters)
     {
         ....
  
         int status =  CAPI(other parameters, callback, last parameter);
     }
  
  };
  </code></pre>
  
  <p>The prototype of CAPI is </p>
  
  <pre><code>herr_t CAPI( some parameters, H5L_iterate_t op, other parameters);
  </code></pre>
  
  <p>H5L_iterate_t is defined by </p>
  
  <pre><code>herr_t (*H5L_iterate_t)( hid_t g_id, const char *name, 
                           const H5L_info_t *info, void *op_data) 
  </code></pre>
  
  <p>methodA has the same signature as H5L_iterate_t.<br>
  In methodB,</p>
  
  <pre><code>status = CAPI(..., **(H5L_iterate_t )std::bind(&amp;A::methodA, this,
                std::placeholders::_1)**, ...);
  </code></pre>
  
  <p>The compile error I got was "Can't convert from ... to H5L_iterate_t".  I'm wondering what's the right way to pass the non static member function as a callback.</p>
  
  <p>Thanks in advance. </p>