title: Compare std::function created with std::bind
body: <p>Here is a toy example</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;functional&gt;
  
  struct Obj
  {
    int x;
  
    int foo()
    {
      return 42;
    }
  };
  
  int main()
  {
    Obj a, b;
    std::function&lt;int()&gt; f1 = std::bind(&amp;Obj::foo, &amp;a);
    std::function&lt;int()&gt; f2 = std::bind(&amp;Obj::foo, &amp;b);
    std::function&lt;int()&gt; f3 = std::bind(&amp;Obj::foo, &amp;a);
    std::function&lt;int()&gt; f4 = std::bind(&amp;Obj::foo, &amp;b);
  }
  </code></pre>
  
  <p>How can I verify that <code>f1 == f3</code> and <code>f2 == f4</code>, where the <code>==</code> comparator, here, means that both <code>std::function</code> objects correspond to the same method of the same object?</p>