In C++14, I have a std::vector of values for which I want to remove all elements that match a given value and I do not care about preserving the order of the elements after doing the remove. The specification for std::remove provides that the relative order of the elements that remain is preserved.
Is there a built-in algorithm to do something like a std::remove but that does not preserve the order? I wish to do this since it is less work to just swap elements from the end of the vector into locations to be removed, thus scrambling the order of elements in the vector. The algorithm is still linear in that it has to visit each element to check for removal, but the amount of constant work it has to perform on each element goes way down if only a handful of items end up being removed.