I'm not really sure this question really is about containers, please bear with me.
A game has 'turns' that are incremented, there is no Timer that fires at a certain time.
Now there is also a large bucket of objects, where some of them need updating somtimes. What will happen is that object o1 needs to be updated in n1 turns, object o2 in n2 etc.
The simple solution would:
for (object* o : objectVector) {
o->ctr--;
if (o->ctr == 0) { o->update(); };
}
Now I feel this is terribly inefficient, if I crawl through 1000 objects counters each turn, just to update maybe 10 of them. I'm sure this problem has come up before somewhere!
Also, I can probably allow objects to sometimes update at +/- a few turns around their expected update.
I was thinking I could have many vectors, one for the next 5, one for the 5-10, one for 10-15 turns in the future and so forth. But then I have too many vectors, should some objects only need to be updated in say, 100 turns..