title: Insert into vector with conditional iterator
body: <p>Say I have a <code>vector</code> with various entries, which I want to insert into another vector, while leaving out entries that satisfy a condition.</p>
  <p>For example, I want to insert a vector while leaving out all three's.</p>
  <pre><code>{1, 3, 2, 3, 4, 5, 3} -&gt; { /* previous content, */ 1, 2, 4, 5}
  </code></pre>
  <p>What I came up with so far uses <code>std::partition</code>, which does not preserve the relative order and rearranges the source vector.</p>
  <pre><code>std::vector&lt;int&gt; source({1, 3, 2, 3, 4, 5, 3});
  std::vector&lt;int&gt; target;
  
  auto partition = std::partition(std::begin(source),
                     std::end(source), [](const auto&amp; a) { return a == 3; });
  target.insert(std::begin(target), partition, std::end(source));
  </code></pre>
  <p><strong>What I am looking for</strong> is more of an iterator that checks a condition and moves on if the condition is not satisfied. Something like this:</p>
  <pre><code>target.insert(std::begin(target),
                conditional_begin(source, [](const auto&amp; a) { return a != 3; }),
                conditional_end(source));
  </code></pre>
  <p>I suppose a <code>conditional_end</code> function would be necessary, since <code>std::end</code> would return a different iterator type than <code>conditional_begin</code>.</p>
  <p>Maybe I have overlooked something, so my <strong>questions</strong> are:</p>
  <ul>
  <li>Does the standard library provide something similar?</li>
  <li>Is there a different easy way to achieve my goal?</li>
  <li>Is there an easy way to implement the conditional iterator functionality?</li>
  </ul>