Function that takes an STL iterator over ANY container of a elements of a specific type
<p>How would I define a function that takes as input an iterator over any type of STL container, but only to those of a specific templated type. For example:</p>

<p>Any iterator of the form <code>std::list&lt;Unit*&gt;::iterator</code> <strong>or</strong> <code>std::vector&lt;Unit*&gt;::iterator</code></p>

<p>I would just define the function to take <code>std::list&lt;Unit*&gt;::iterator</code>, but if we switch to a different STL container, I don't want to have to change my code.</p>

<p>Is there a way to do this with templates or otherwise?</p>
