Actually, I figured it out:
for (ArbIter arb = arbiters.begin(); arb != arbiters.end(); ++arb) { // Erase key from set, modify it, then add it again. Arbiter newArb = *arb; arbiters.erase(arb); newArb.PreStep(inv_dt); arbiters.insert(newArb); //(*arb).PreStep(inv_dt); }
Er, the code above wasn't quite right.
while (arb != arbiters.end()) { // Erase key from set, modify copy, then add it again. Arbiter newArb((*arb).body1, (*arb).body2); newArb.PreStep(inv_dt); arbiters.erase(arb++); arbiters.insert(newArb); }
-- GBGames' Blog, An Indie Game Developer's Somewhat Interesting Thoughts: http://www.gbgames.com/blog Staff Reviewer for Game Tunnel, the Independent Underground: http://www.gametunnel.com