title: Dereference iterator as part of a boost::bind composite chain
body: <p>I am trying to use bind to produce a function that:</p>
  
  <ul>
  <li>Receives a map m</li>
  <li>returns m.begin()->first</li>
  </ul>
  
  <p>For that I am trying to use boost::bind:</p>
  
  <pre><code>typedef map&lt;int,int&gt;::const_iterator (map&lt;int,int&gt;::*const_begin_end) () const;
  bind(&amp;pair&lt;const int,int&gt;::first, bind(static_cast&lt;const_begin_end&gt;(&amp;map&lt;int, int&gt;::begin), _1));
  </code></pre>
  
  <p>This doesn't work because the result of begin needs to be dereferenced. I thought something like</p>
  
  <pre><code>bind(&amp;pair&lt;const int,int&gt;::first, bind(&amp;operator*, bind(static_cast&lt;const_begin_end&gt;(&amp;map&lt;int, int&gt;::begin), _1)));
  </code></pre>
  
  <p>But this wouldn't work since there is no global operator*.</p>
  
  <p>Questions:</p>
  
  <ul>
  <li>Is it possible to achieve this using boost::bind composite chains? How?</li>
  <li>More easily readable alternatives?</li>
  </ul>