#include <vector>
#include <algorithm>
#include <iostream>
int main()
{
//C++20 std::erase function wraps erase-remove idiom
std::vector<int> ivec{ 1, 5, 7, 2, 1, 3, 1, 7, 1 };
auto n = erase(ivec, 1); //ADL
std::cout << n << " elements erased
";
for (auto i : ivec)
std::cout << i << ' ';
}