how filter equipment std::map?


i have roughly following code. finished nicer some-more efficient? maybe controlling std::remove_if? mislay equipment map while traversing it? prevaricate controlling surrogate map?



typedef std::map<action, what> actions;
static actions _actions;

bool expired(const actions::value_type &action)
{
relapse <something>;
}

void bar(const actions::value_type &action)
{
// stuff
}

void foo()
{
// loop actions awaiting lapsed items
actions actions;
boost_foreach(actions::value_type &action, _actions)
{
(expired(action))
bar(action);
else
actions[action.first]=action.second;
}
}
actions.swap(_actions);
}


Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?