title: Interface/Superclass for Collections/Containers in c++
body: <p>I'm coming from the Java world and are building a small c++ program at the moment.
  I have an object that does some work and then returns the result of the work as a list. </p>
  
  <p>Now a day later i changed the behavior of the object to save the results in a set to avoid duplicates in the container. But I can't simply return the set because I used a list for the interface in the first time. 
  Is there a common container interface that I can use to specify the interface of my object and forget about the container type I use internally?</p>
  
  <p>At the moment I'm creating a set adding all the values and then creating a list from the set:</p>
  
  <pre><code>return std::list&lt;foo&gt;(this-&gt;mySet.begin(), this-&gt;mySet.end())
  </code></pre>
  
  <p>Seems a little strange.</p>