You can always iterate without an enumerator.
Which means a regular for loop, and when you remove an object:- decrement the index variable and continue;.
if you are caching the array's count before entering the for-loop, then make sure you decrement that too when removing an object.
Anyway, I do not see why an array with objects for later removal would be a problem. I do not know the exact situation which you are having and the technologies involved, but theoretically there should not be a problem.
Because in most cases when using this method you can just do nothing in the first enumeration, and do the real work when enumerating the removal array.
And if you have a situation where in the first enumeration you are checking something again against the same array and you need to know that the objects are not there anymore, you can just add a check to see if they are in the removal array.
Anyway, hope I helped.
Good luck!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…