title: std::copy to std::cout for std::pair
body: <p>I have next code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;algorithm&gt;
  #include &lt;map&gt;
  #include &lt;iterator&gt;
  
  //namespace std
  //{
  
  std::ostream&amp; operator &lt;&lt; ( std::ostream&amp; out, 
                  const std::pair&lt; size_t, size_t &gt;&amp; rhs )
  {
      out &lt;&lt; rhs.first &lt;&lt; ", " &lt;&lt; rhs.second;
      return out;
  }
  //}
  
  int main() 
  {
  
      std::map &lt; size_t, size_t &gt; some_map;
  
      // fill  some_map with random values
      for ( size_t i = 0; i &lt; 10; ++i )
      {
          some_map[ rand() % 10 ] = rand() % 100;
      }
  
      // now I want to output this map
      std::copy( 
          some_map.begin(), 
          some_map.end(), 
          std::ostream_iterator&lt; 
                std::pair&lt; size_t, size_t &gt; &gt;( std::cout, "\n" ) );
  
      return 0;
  }
  </code></pre>
  
  <p>In this code I just want copy map to output stream. For do this I need define operator &lt;&lt;(..) - OK.
  But according names finding rules compiler can't find my operator&lt;&lt;().<br>
  Because std::cout, std::pair and std::copy which called my operator&lt;&lt; - all from namespace std.</p>
  
  <p>Quick solution - add my oerator&lt;&lt; to std namespace - but it is ugly, imho.</p>
  
  <p>What solutions or workaround for this problem do you know?</p>