title: Rotating a vector (array)
body: <p>I am trying to rotate a vector of elements in C++. What I mean by that is that I have a <code>vector&lt;point&gt;</code> I want the last element to become the first.</p>
  <p>Example:</p>
  <blockquote>
  <p>[1,2,3] become [3,1,2] then [2,3,1]</p>
  </blockquote>
  <p>For that I tried to do the following:</p>
  <pre><code>//Add the last element at index 0
  ObjectToRotate.insert(0, ObjectToRotate.at(ObjectToRotate.size()-1));
  //Remove Last element
  ObjectToRotate.erase(ObjectToRotate.size()-1);
  </code></pre>
  <p>but I get this error:</p>
  <blockquote>
  <p>Error  6   error C2664: 'std::_Vector_iterator&lt;_Myvec&gt; std::vector&lt;<em>Ty&gt;::insert&lt;cv::Point</em>&lt;_Tp&gt;&amp;&gt;(std::_Vector_const_iterator&lt;_Myvec&gt;,_Valty)' : cannot convert parameter 1 from 'int' to 'std::_Vector_const_iterator&lt;_Myvec&gt;'</p>
  </blockquote>
  <p>How can I solve it?</p>