https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91620
--- Comment #2 from frankhb1989 at gmail dot com --- I missed `unique` should be also affected. The fixes have been applied in libc++ in the same commit to fix `remove_if`. MSVC's current implementations are also correct, with a different implementation strategy. It uses a singly liked list for nodes pending to delete.