Keep track of the time step separately for each object. Default to 10ms (or your global time step), but allow other intervals to be specified (so that an object only simulates for part of the step).
Advance the whole simulation with small sub-timesteps until the next object creation event occurs (e.g. 1ms). Then advance by the time until the next object creation event occurs (e.g. 2ms - 1ms = 1ms). Next: (5ms - 2ms = 3ms), then (10ms - 5ms = 5ms) to complete the global time step. This is similar to the approach used for continuous collision detection that finds the next time of collision.
I used option one, and it seemed to have worked I believe :3.
++iterator won't fix it. The problem is you use iterator in the same loop iteration in which you decremented iterator. It causes you to go back to the previous iteration value too early. By the time the execution reaches the top of the loop the error has already occurred. Using erase would fix the issue, but erase might be slow if you have a large number of particles. Your swap and pop method is superior from a performance perspective. Try this:
I moved currentSize so it only gets calculated when you update the size. The more important change is that since you either want to delete the current particle or you want to increment the y value so I put the y increment in the else statement which you already had!
And slight addendum to my '-1' bug comment. You use an unsigned int so it wouldn't be negative, it would be very large.
edit: edited for clarity.
Unfortunately I tried this and it didn't work either. I tried different combinations and tried placing the statements in different places. I have an itching feeling that it may be an issue with the swap function or the pop function., cuz I never have problems doing these kind of loops in python or other languages, where I decrement the iterator inside the loop so I don't skip elements.
You should consider using your debugger and stepping through the code. I think I have a handle on what might be going on though. First, let's say you have particleList.lifeTime == 1.0f and then you enter this loop. iterator is 0 so particleList.lifeTime will decrement to lifeTime 0.0f so you swap and pop the element then decrement interator to -1. Then you access particleList[-1].y which doesn't exist so who knows what your program will do if it tries to access that memory.
Now, I also think this bug is causing your issues with the weird multiple increases. If particleList.lifeTime == 2.0f and particleList.lifeTime == 1.0f then at the start of the loop when iterator == 0, particleList will remain in the list and particleList.y will increment by 0.01f. iterator will increment to 1. So next particleList will be swapped and deleted because its lifetime reaches 0. When this happens, iterator is set to 0 and particleList.y will increment by 0.01f again for 0.02f total.
So, exercise for the reader: solve this bug!
Ah, I thought that it would increment as soon as it re-entered the for loop. I guess I dun goofed. I think I have to use ++iterator instead of iterator++. Either way I solved it by using particleList.erase(). I will try the ++ method thoush. Update: it didn't work .