How do I compare a std::function's target with a member function's address?
<p>I am trying to figure out how to compare a function object's target (which is a member function) with the actual member function.
Of course, they should match.</p>

<p>But I don't get them to match, and I am lost with the syntax for declaring a member function as the type for the function object.</p>

<p>Here is some code:</p>

<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &lt;functional&gt;
using namespace std;


class Object {
public:
    void method () {}
};


int main(int argc, char** argv) {

    Object* obj = new Object();
    function&lt;?????&gt; wrapper = bind(&amp;Object::method, obj);
    if (wrapper.target&lt;?????&gt;() == &amp;Object::method) {
        cout &lt;&lt; "match" &lt;&lt; "\n";
    } else {
        cout &lt;&lt; "no match" &lt;&lt; "\n";
    }   
    delete(obj);

    return 0;
}
</code></pre>

<p>I tried to put different things instead of the ?????, but without any success.</p>

<p>So, what do I write instead of the questions marks, or are there other problems with this code?</p>