title: Is it possible to iterate over a `const vector<int>`?
body: <p>Is it possible to iterate over a <code>const vector&lt;int&gt;</code>? Or, would this be undesirable anyway?</p>
  
  <p>Given I have the function <code>getIntVector</code> which returns a <code>vector&lt;int&gt;</code> I can iterate over it with the following:</p>
  
  <pre><code>vector&lt;int&gt; vec = getIntVector();
  vector&lt;int&gt;::iterator it;
  for (it=vec.begin();it!=vec.end();++it) {} 
  </code></pre>
  
  <p>But I can not do the following:</p>
  
  <pre><code>const vector&lt;int&gt; vec = getIntVector();
  vector&lt;int&gt;::iterator it;
  // complier throws error below
  for (it=vec.begin();it!=vec.end();++it) {} 
  </code></pre>
  
  <p>My thinking was that the vector would not be recreated by declaring it as a <code>const</code>....</p>