title: STL Container constructed from other container (e.g. list from vector)
body: <p>In my code, sometimes I need to construct a container from another container. But these container objects are of different types, so I can't use a copy constructor. What I do looks like this (C++11, I use uniform initialization and constructor delegation) :</p>
  
  <pre><code>std::vector&lt;int&gt; source {1, 3, 5, 7, 9};
  std::list&lt;int&gt; destination (source.begin (), source.end ());
  </code></pre>
  
  <p>I realized that std::list could have a constructor like this, to make things prettier:</p>
  
  <pre><code>template &lt;/* ... */&gt;
  class list
  {
  public:
      template &lt;class Container&gt; list (const Container&amp; container)
      : list (container.begin (), container.end ())
      {
      }
  
      /* ... */
  };
  </code></pre>
  
  <p>Unfortunately I can do this only for my own classes, not for STL classes. So first question, of there a reason such costructors don't exist in STL and Boost? And second question, is there a safe way to implement such a ctor for STL containers, maybe by defining conversion operators somehow?</p>
  
  <p>This issue os of course just a matter of convenience, nothing critical to code or to program behavior. But it could make the code look a bit more readable:</p>
  
  <pre><code>std::vector&lt;int&gt; source {1, 3, 5, 7, 9};
  std::list&lt;int&gt; destination = source;
  </code></pre>