Performs a conditional replacement operation on the sequence. The algorithm returns a new sequence which contains all the elements from <code>[begin<Sequence>::type, end<Sequence>::type)</code> range where every type that satisfies the predicate <code>Pred</code> has been replaced with a <code>NewType</code>. The result sequence preserves all the functional and performance characteristics of the original <code>Sequence</code>, including its size, but not identity.
<tr><td><code>Sequence</code></td><td>A model of <ahref="../Extensible_Sequence.html">Extensible Sequence</a></td><td>The original sequence. </td></tr>
<tr><td><code>typedef replace_if<Sequence,Pred,NewType>::type s;</code></td><td>A model of <ahref="../Extensible_Sequence.html">Extensible Sequence</a></td><td></td><td>Equivalent to <code>typedef lambda<Pred>::type pred; typedef transform< Sequence, if_< apply1<pred,_1>,NewType,_1>>::type t;</code>.</td><td></td></tr>
</table>
<p>
<h3>Complexity</h3>
<p>
Linear. Performs exactly <code><ahref="../Reference/size.html">size</a><Sequence>::type::value</code> applications of <code>Pred</code>, and at most <code><ahref="../Reference/size.html">size</a><Sequence>::type::value</code> insertions.