<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>Hello.</div><div><br></div>std::remove_if doesn&#39;t have any specified evaluation order of predicate, unlike e.g. std::for_each that is explicitly required to evaluate predicate from first to last element in range.<div><br><div>Is there any reason why it is so?</div></div><div>Do you maybe know any implementation that has a different implementation?</div><div>I cannot imagine any sane implementation benefitting from unspecified order of evaluation.</div><div>It would be nice to have the order explicitly specified in standard.</div><div><br></div><div>In my current task I need a function that sequentially iterates a vector and removes some elements based on prior elements values. And apparently I cannot use std::remove_if because I cannot be sure that predicate for the first element is called first, and so on.</div><div><br></div><div>How dangerous it would be to rely on this implementation detail and use std::remove_if for this task?</div><div><br></div><div>Thanks.</div></div>
</div></div>

