If it was called shuffle_to_end_if you’d know what it means.
That would be incorrect, because remove_if leaves the garbage elements in a valid but unspecified state (they may be unchanged, swapped, or otherwise). It's not partition or stable_partition which are permutations.
View all comments
Show parent comment
17
u/STL MSVC STL Dev Aug 21 '26
That would be incorrect, because
remove_ifleaves the garbage elements in a valid but unspecified state (they may be unchanged, swapped, or otherwise). It's notpartitionorstable_partitionwhich are permutations.Source: Fixed this with
erase_if😺