- typedef hash_map<u32,UObjectRef> hs;
- typedef hs::iterator OH_iterator;
- ....
- hs hash;
- OH_iterator reap_iterator;
- ...
- while (...)
- {
- OH_iterator save_iterator = reap_iterator;
- ++reap_iterator;
- if (...)
- {
- hash.erase( save_iterator );
- }
- if (reap_iterator == hash.end())
- {
- reap_iterator = hash.begin();
- if (reap_iterator == hash.end())
- break;
- }
- }