title: How do I remove the first occurrence of a value from a vector?
body: <p>I'm trying to get a single element from a vector and push it to the back of the vector then remove it so I won't have an empty section in memory. The erase-remove idiom can do this but it removes <em>all</em> instances of a particular value. I just want the first one removed.</p>
  
  <p>I'm not too experienced with standard library algorithms and I can't find the appropriate methods (if any) to do this. Here is an example:</p>
  
  <pre><code>int main() {
      std::vector&lt;int&gt; v{1, 2, 3, 3, 4};
  
      remove_first(v, 3);
  
      std::cout &lt;&lt; v; // 1, 2, 3, 4
  }
  </code></pre>
  
  <p>So how would I go about removing the first occurance of a 3 from this vector?</p>