to insert() or to make new
<p>I'm writing some code that has a lot of substitution.</p>

<p>There's a <b>list&lt;char&gt; productions</b> which has a bunch of characters in it.</p>

<p>I repeatedly need to replace every character in <b>productions</b> with the rules corresponding to it in a <b>map&lt;char,char*&gt; productionRules</b>.  So every character in <b>productions</b> might be replaced by zero or more characters as indicated by <b>productionRules</b>.</p>

<p>I'm thinking there's 2 ways to do it:</p>

<ol>
<li><p>iterate over <b>productions</b> and .insert() all replacement characters in <b>productions</b> before <a href="http://stackoverflow.com/questions/1038708/erase-remove-contents-from-the-map-or-any-other-stl-container-while-iterating#1038757">.erase()'ing</a> each element</p></li>
<li><p>Create a NEW <b>list&lt;char&gt; newProductions</b> then reassign productions to refer to <b>newProductions</b>.</p></li>
</ol>

<p>Which is better?  To .insert() and .erase() a whole lot or to just create a new one?</p>
