How to simulate the nonexistent find_first_not_of function?

Viewed 1364

The std::basic_string class template has member functions find_first_of and find_first_not_of.

The <algorithm> header, however, contains only a generic find_first_of.

Question1: Is the absence of

std::find_first_not_of(Iter1 first1, Iter1 last1, Iter2 first2, Iter2 last2)

just an oversight (as for example copy_if) or is it intentionally omitted because the behavior can be achieved with another standard function?

Of course I could write my own find_first_not_of, but

Question2: Is there a ready workaround somewhere in <algorithm>? For example, the absence of copy_if is compensated by the presence of remove_copy_if

Thanks in advance

4 Answers
Related