title: Passing a member function as standard function callback
body: <p>I've been struggling for hours with the same part of the code, and I cannot find any answer that can guide me.</p>
  
  <p>I'm using a library, and a method requires to pass a callback as parameter. See <a href="https://github.com/knolleary/pubsubclient/blob/master/src/PubSubClient.h#L121" rel="nofollow noreferrer">here</a>.</p>
  
  <pre><code>PubSubClient&amp; setCallback(MQTT_CALLBACK_SIGNATURE);
  </code></pre>
  
  <p>And I'm trying to trigger this method, from a member function, like this:</p>
  
  <pre><code>void HouseKeeper::callback(char* topic, uint8_t* payload, unsigned int length) {
      // Do something
  }
  
  boolean HouseKeeper::connect() {
      library.setCallback(callback);
  }
  </code></pre>
  
  <p>The error compiler gives, is the following:</p>
  
  <pre><code>no matching function for call to
  'PubSubClient::setCallback(&lt;unresolved overloaded function type&gt;)'
  
  note: no known conversion for argument 1 from '&lt;unresolved overloaded function type&gt;' to 'std::function&lt;void(char*, unsigned char*, unsigned int)&gt;'
  </code></pre>
  
  <p>I'm quite new with C++, so even the basics are still far away from me.</p>