title: How do I write a for loop that iterates over a CAtlMap selectively deleting elements as it goes?
body: <p>I'm trying to do the following without too much special case code to deal with invalidated POSITIONs etc:</p>
  
  <p>What's the best way to fill in the blanks?</p>
  
  <pre><code>void DeleteUnreferencedRecords(CAtlMap&lt;Record&gt;&amp; records)
  {
     for(____;____;____)
     {
        if( NotReferencedElsewhere(record) )
        {
          // Delete record
          _______;
        }
     }
  }
  </code></pre>