title: Cannot convert from one iterator type to another but both are the exact same
body: <p>I'm attempting to compile the <a href="http://code.google.com/p/zipstream/" rel="nofollow">ZipStream</a> library, it is effectivley a C++ wrapper for zlib.</p>
  
  <p>Right now I'm at the point where I'm getting two compile errors on these two lines:</p>
  
  <pre><code>std::set&lt;file_info_32*, sort_by_offset&gt;::iterator first  = _core-&gt;_entries_by_name.begin();
  std::set&lt;file_info_32*, sort_by_offset&gt;::iterator last   = _core-&gt;_entries_by_name.end();
  </code></pre>
  
  <p>The errors are:</p>
  
  <blockquote>
    <p>Error  15  error C2440: <code>'initializing'</code> : cannot convert from<br>
    <code>'std::_Tree_const_iterator&lt;_Mytree&gt;'</code> to<br>
    <code>'std::_Tree_const_iterator&lt;_Mytree&gt;'</code>  c:\users\ahakeem\desktop\zipstream\ziparchive.cpp   423 1   zipstream<br>
    Error   16  error C2440: <code>'initializing'</code> : cannot convert from<br>
    <code>'std::_Tree_const_iterator&lt;_Mytree&gt;'</code> to<br>
    <code>'std::_Tree_const_iterator&lt;_Mytree&gt;'</code>  c:\users\ahakeem\desktop\zipstream\ziparchive.cpp   424 1   zipstream</p>
  </blockquote>
  
  <p>So basically the compiler says it can't convert from <code>'std::_Tree_const_iterator&lt;_Mytree&gt;'</code> to <code>'std::_Tree_const_iterator&lt;_Mytree&gt;'</code></p>
  
  <p>Any ideas why it's happening and how to fix?</p>
  
  <p>edit: after further investigating I've found that <code>_core-&gt;entries_by_name.begin()</code> is declared as <code>'std::set&lt;file_info_32*, sort_by_offset&gt;'</code>, which is obviously inconsistant with what its iterator is trying to be assigned to (<code>std::set&lt;file_info_32*, sort_by_offset&gt;</code>).</p>
  
  <p>Switching it to <code>_core-&gt;_entries_by_offset.begin();</code> works because <code>_entries_by_offset</code> is a type consistant with what the assignee is expecting to get.</p>
  
  <p>Does this mean someone may have broken the code, didn't realize it and uploaded it to the source repo? Or can this scenario of erraneous assignment actually compile on some systems?</p>