title: Declare a function accepting generic iterator
body: <p>Given this code, is it possible to change <code>dumpStrings()</code> to be able to iterate over any container of <code>string</code>, like say a <code>list&lt;string&gt;</code> ? </p>
  
  <pre><code>#include &lt;vector&gt;
  #include &lt;string&gt;
  #include &lt;ostream&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  void dumpStrings(vector&lt;string&gt;::iterator it, vector&lt;string&gt;::iterator end)
  {
      while (it != end) {
          cout &lt;&lt; *it++ &lt;&lt; endl;
      }
  }
  
  int main()
  {
      vector&lt;string&gt; strVector;
      strVector.push_back("Hello");
      strVector.push_back("World");
  
      dumpStrings(strVector.begin(), strVector.end());
      return 0;
  }
  </code></pre>