title: Is it possible for C++ to write a template that takes a Container as parameter?
body: <p>I would try to make my point clear with an example:</p>
  
  <p>We have </p>
  
  <pre><code>template &lt;class RandomAccessIterator&gt;
  void sort (RandomAccessIterator first, RandomAccessIterator last);
  </code></pre>
  
  <p>But I'm thinking if it is ok to make it more convenient:</p>
  
  <pre><code>template &lt;typename T&gt; void sort(std::vector&lt;T&gt;&amp; container) {
      std::sort( container.begin(), container.end() );
  }
  template &lt;typename T&gt; void sort(std::list&lt;T&gt;&amp; container);
  template &lt;typename T&gt; void sort(std::array&lt;T&gt;&amp; container);
  //e.t.c
  </code></pre>
  
  <p>You know there are many container types, it is possible to code once for all the container types?</p>
  
  <pre><code>void sort(ContainerType&lt;ElementType&gt; &amp;container); 
  //and container should have begin() and end() methods,
  //otherwise the compiler would warn me.
  </code></pre>