title: How to get a range of items from vector in C++
body: <p>I need to get a range of elements from <code>std::vector</code>. Similar to the python slice operator:</p>
  <pre class="lang-py prettyprint-override"><code>range = vector[0:n]
  </code></pre>
  <p>The obvious way is to iterate through the required elements. Is there any other better way?</p>