Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 17th, 2012  |  syntax: None  |  size: 0.38 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         typedef hash_map<u32,UObjectRef> hs;
  2.         typedef hs::iterator OH_iterator;
  3.        
  4.         ....
  5.  
  6.         hs hash;
  7.         OH_iterator reap_iterator;
  8.        
  9.         ...
  10.        
  11.         while (...)
  12.         {
  13.                 OH_iterator save_iterator = reap_iterator;
  14.                 ++reap_iterator;
  15.  
  16.                 if (...)
  17.                 {
  18.                         hash.erase( save_iterator );
  19.                 }
  20.  
  21.                 if (reap_iterator == hash.end())
  22.                 {
  23.                         reap_iterator = hash.begin();
  24.                         if (reap_iterator == hash.end())
  25.                                 break;
  26.                 }
  27.         }