title: Why std::distance doesnt work on mix of const and nonconst iterators?
body: <p>Like the question says, I'm wondering about the reason for that. Because I get an error when I try to get the distance between <code>const</code> and non-<code>const</code> iterators. </p>
  
  <pre><code>vector&lt;int&gt; v;
  auto it=v.begin();
  auto cit=v.cbegin();
  distance(it,cit);
  
  
  no matching function for call to ‘distance(__gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt;&amp;, __gnu_cxx::__normal_iterator&lt;const int*, std::vector&lt;int&gt; &gt;&amp;)
  </code></pre>
  
  <p>From my limited understanding of iterators, I see no reason why it shouldn't work. </p>