title: Template argument for template type parameter must be a type
body: <p>I am working on a <code>template Subject class</code> I will use as a base class for some event-driven programming. Currently, I am working on callback registration and I received "<code>Template argument for template type parameter must be a type; did you forget 'typename'?</code>" at the line of <code>std::map</code>.</p>
  
  <p>I feel that the answer is related with <a href="https://stackoverflow.com/questions/1600936/officially-what-is-typename-for">this link</a>, but I could not form it to solve my problem.</p>
  
  <p>Here's the header of <code>Subject</code> class:</p>
  
  <pre><code>#ifndef Subject_hpp
  #define Subject_hpp
  
  #include "Observer.hpp"
  
  #include &lt;list&gt;
  #include &lt;map&gt;
  
  template&lt;class T&gt;
  class Subject
  {
  public:
      Subject();
      virtual ~Subject();
  
      virtual void attach( Observer* const object, void(Observer::* const func)(T) );
      virtual void detach(const int pObserverId);
      virtual void notify(T&amp; pEvent);
  
      // Clear the subject: Clear the attached observer list
      void clear();
  
  private:
  
  
      std::list&lt; std::function&lt;void(T)&gt; &gt; mObserverList;
  
      // For a better callback management in case they will
      // be required to remove before the application is terminated
      std::map&lt;int, std::list&lt; std::function&lt;void(T)&gt; &gt;::iterator&gt; mObserverRegister; // Throws: Template argument for template type parameter must be a type; did you forget 'typename'?
  
  };
  
  #endif /* Subject_hpp */
  </code></pre>
  
  <p><code>T</code> in here will be a <strong>user-defined event class</strong> such as <code>MouseEvent</code>, <code>KeyboardEvent</code>, etc.</p>