title: Help me understand this usage of boost::bind
body: <p>Please have a look at this example posted by Johannes Schaub to sort a vector of pairs:</p>
  
  <p><a href="https://stackoverflow.com/questions/279854/how-do-i-sort-a-vector-of-pairs-based-on-the-second-element-of-the-pair/280128#280128">How do I sort a vector of pairs based on the second element of the pair?</a></p>
  
  <pre><code>std::sort(a.begin(), a.end(), 
            boost::bind(&amp;std::pair&lt;int, int&gt;::second, _1) &lt;
            boost::bind(&amp;std::pair&lt;int, int&gt;::second, _2));
  </code></pre>
  
  <p>I thought I do understand boost::bind, but I have trouble with this one.</p>
  
  <p><strong>Question 1:</strong></p>
  
  <p>the sort algorithm is expecting a predicate function as a third parameter. What I see here, is a boolean expression. What am I missing?:</p>
  
  <pre><code>boost::bind(&amp;std::pair&lt;int, int&gt;::second, _1) &lt; boost::bind(&amp;std::pair&lt;int, int&gt;::second, _2)
  </code></pre>
  
  <p>Does the boost::bind library overload operator&lt; for those two binds, and is returning some kind of function pointer (like a lambda)?</p>
  
  <p><strong>Question 2:</strong><br>
  This gets me confused:</p>
  
  <pre><code>boost::bind(&amp;std::pair&lt;int, int&gt;::second, _1)
  </code></pre>
  
  <p>Usually there is some kind of function pointer as first parameter of a bind call, but here it is an address of a class member? What is the result of that particular bind?</p>
  
  <p>Thanks for your time &amp; help</p>