I am using an (external) function that receives two output-iterators as arguments and fills them with something. The usage is like this
std::vector<X> vals_X;
std::vector<Y> vals_Y;
f(std::back_inserter(vals_X),std::back_inserter(vals_Y));
In my application, I only need the vector vals_X, so I just fill vals_Y and ignore it. That is inefficient, as the vectors can be quite large. I would like to pass an iterator that "pipes to /dev/null", so it just forgets all values it receives right away.
I was surprised that I could not find a standard solution for that. I did find std::ignore, but I cannot pass it as second argument as it does not provide ++, resulting in a compiler error.