title: Rcpp/RcppArmadillo: removing non-contiguous elements from a vector based on positions
body: <p>Let's say I have a vector [2,4,6,8,10], and I need to remove the 2nd <strong>and</strong> the 4th elements from this vector. The desired resulting vector should be [2,6,10]. This is very easy to implement in R:</p>
  
  <pre><code>v1 &lt;- c(2,4,6,8,10)
  v1[-c(2,4)]
  </code></pre>
  
  <p>But how do I implement this in Rcpp/RcppArmadillo? I can figure out the contiguous case (i.e. removing the 2nd <strong>through</strong> the 4th elements) by using the <code>.erase()</code> function, but the non-contiguous case doesn't seem so obvious to me since <code>.erase</code> does not seem to accept <code>uvec</code> type of vectors. Speed could be a consideration because v1 could be quite large in my application.</p>
  
  <p>EDIT: Either Rcpp or Armadillo implementation is fine by me as I am using both.</p>