title: Convert iterator to pointer?
body: <p>I have a <code>std::vector</code> with <code>n</code> elements. Now I need to pass a pointer to a vector that has the last <code>n-1</code> elements to a function.</p>
  
  <p>For example, my <code>vector&lt;int&gt; foo</code> contains <code>(5,2,6,87,251)</code>. A function takes <code>vector&lt;int&gt;*</code> and I want to pass it a pointer to <code>(2,6,87,251)</code>.</p>
  
  <p>Can I just (safely) take the iterator <code>++foo.begin()</code>, convert it to a pointer and pass that to the function? Or use <code>&amp;foo[1]</code>?</p>
  
  <p><strong>UPDATE:</strong> People suggest that I change my function to take an iterator rather than a pointer. That seems not possible in my situation, since the function I mentioned is the <code>find</code> function of <code>unordered_set&lt;std::vector*&gt;</code>. So in that case, is copying the <code>n-1</code> elements from <code>foo</code> into a new vector and calling <code>find</code> with a pointer to that the only option? Very inefficient! It's like Shlemiel the painter, especially since i have to query many subsets: the last <code>n-1</code>, then <code>n-2</code>, etc. elements and see if they are in the <code>unordered_set</code>.</p>