title: C++ Error: No type named 'iterator' in 'e<CD>' (New to iterators)
body: <p>Very new to iterators, and having quite a bit of trouble here. 
  The error seems very simple, but i'm not sure how to define a type iterator within a class template.
  Help would be very appreciated!</p>
  
  <p>Header File: </p>
  
  <pre><code>template&lt;class T&gt;
  class e
  {
  private:
      set&lt;T&gt; items;         //set container for items of type T
  public:
      typename set&lt;T&gt;::iterator it;
      bool add(T);
      int size();
      typename set&lt;T&gt;::iterator begin(); //return iterator it (beginning of items)
      typename set&lt;T&gt;::iterator end();   //return iterator it (end of items)
  };
  </code></pre>
  
  <p>Code block where error occurs: </p>
  
  <pre><code>for(e&lt;CD&gt;::iterator p=updatableAlbumSet.begin(); p!=updatableAlbumSet.end();p++){
                  ((CD)(*p)).saveAlbum(fout);         
              }
  </code></pre>
  
  <p>error:</p>
  
  <pre><code>error: no type named 'iterator' in 'e&lt;CD&gt;'
                      for(e&lt;CD&gt;::iterator p=updatableAlbumSet.begin(); p!=updatableAlbu...
  </code></pre>