title: How do I iterate over collections generically in C++?
body: <p>Simply put, if I have a set and vector how do I create a generic method that can handle both as params.  </p>
  
  <p>All I want to do, is iterate over either types of collections.  Sounds like it should be trivial but I'm missing something.</p>
  
  <pre><code>void printMeSomeStrings(somebaseclass&lt;string&gt; strings) {
    for (auto&amp; str : strings) {
      cout &lt;&lt; str &lt;&lt; endl;
    }
  }
  </code></pre>
  
  <p>In C#, I would pass IEnumerable or something like that.  Then I could iterate over the collection. </p>
  
  <p>Any general reading explaining the answer would be appreciated.   </p>