title: Why is there no "Iterable" interface in the STL?
body: <p>The C++ STL does not seem to use purely abstract base classes (aka interfaces) very often. I know that most things can be achieved with the STL algorithms or clever template metaprogramming. </p>
  
  <p>But still, for some use cases (for example, in an API, if I do not want to be specific about the type of container I get, just about the elements it contains), an interface of the following form would be nice:</p>
  
  <pre><code>template&lt;typename T&gt; struct forward_iterable {
      struct iterator {
          typedef T  value_type;
          typedef T&amp; reference;
          typedef T* pointer;
          virtual reference operator*() const = 0;
          virtual pointer operator-&gt;() const = 0;
          virtual bool operator==(const iterator&amp;) const = 0;
          virtual bool operator!=(const iterator&amp;) const = 0;
          virtual operator const_iterator() const = 0;
          virtual iterator&amp; operator++() = 0;
          virtual iterator  operator++(int) = 0;
      };
      struct const_iterator { ... };  // similar, but with const references
  
      virtual iterator begin() = 0;
      virtual const_iterator begin() const = 0;
      virtual iterator end() = 0;
      virtual const_iterator end() const = 0;
  };
  </code></pre>
  
  <p>If the STL containers implement this class as non-virtual function, this would, in my opinion, not affect performance (if I use the containers directly and not via this interface). So why are there so few "interfaces" in the STL? Or am I just thinking too much in "Java" terms?</p>