title: Boost::bind and std::copy
body: <p>I'm trying to use Boost::bind and std::copy to print out the values in a list of lists.  Obviously, I could use loops, and I may end up doing so for clarity, but I'd still like to know what I'm doing wrong here.</p>
  
  <p>Here is the distilled version of my code:</p>
  
  <pre><code>#include &lt;boost/bind.hpp&gt;
  #include &lt;iterator&gt;
  #include &lt;algorithm&gt;
  #include &lt;list&gt;
  #include &lt;iostream&gt;
  using namespace std;
  using namespace boost;
  
  int main(int argc, char **argv){
  list&lt;int&gt; a;
  a.push_back(1);
  
  list&lt; list&lt;int&gt; &gt; a_list;
  a_list.push_back(a);
  
  ostream_iterator&lt;int&gt; int_output(cout,"\n");
  
  for_each(a_list.begin(),a_list.end(),
    bind(copy,
      bind&lt;list&lt;int&gt;::iterator&gt;(&amp;list&lt;int&gt;::begin,_1),
      bind&lt;list&lt;int&gt;::iterator&gt;(&amp;list&lt;int&gt;::end,_1),
      ref(int_output)
    ) //compiler error at this line
  );
  return 0;
  </code></pre>
  
  <p>}</p>
  
  <p>The compiler error starts off</p>
  
  <pre><code>error: no matching function call to bind(&lt;unresolved overloaded function type&gt; .....
  </code></pre>
  
  <p>I think this means that bind can't figure out what the return type for the outermost bind should be.  I don't blame it, because I can't either.  Any ideas?</p>