On Tue, Sep 16, 2025 at 8:58 PM Peter Neiss via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
As I understand the problem of std::set_intersection better now, i do not believe anymore that it is a good idea to relax the precondition to make inplace usage possible.

Instead I would like to propose and get feedback for following solution:

auto remove_missing = [](auto first1, auto last1, auto first2, auto last2, auto comp)
{
return std::remove_if(
first1, last1,[&](auto const& elem)
{ return not std::binary_search(first2, last2, elem, comp); }
);
};

Regarding this I forgot to mention Boost has a similar helper, is_any_of, unfortunately it seems to be written just for chars, so it may not be fully generic, I did not check if it works for generic T.