title: template class c++
body: <p>i try to design a template for my university project. i wrote the follwing code:</p>
  
  <pre><code>#ifndef _LinkedList_H_
  #define _LinkedList_H_
  #include "Link.h"
  #include &lt;ostream&gt;
  template &lt;class L&gt;//error one
  class LinkedList
  {
  private:
   Link&lt;L&gt; *pm_head;
   Link&lt;L&gt; * pm_tail;
   int m_numOfElements;
   Link&lt;L&gt;* FindLink(L * dataToFind);
  public:
   LinkedList();
   ~LinkedList();
   int GetNumOfElements(){return m_numOfElements;}
   bool Add( L * data);
   L *FindData(L * data);
  
  template &lt;class L&gt; friend ostream &amp; operator&lt;&lt;(ostream&amp; os,const LinkedList&lt;L&gt; listToprint);//error two
     L* GetDataOnTop();
     bool RemoveFromHead();
     L* Remove(L * toRemove);
  </code></pre>
  
  <p>this templete uses the link class templete</p>
  
  <pre><code>#ifndef _Link_H_
  #define _Link_H_
  template &lt;class T&gt;//error 3
  class Link
  {
  private:
   T* m_data;
   Link* m_next;
   Link* m_prev;
  public:
   Link(T* data);
   ~Link(void);
   bool Link::operator ==(const Link&amp; other)const;
  
   /*getters*/
   Link* GetNext()const {return m_next;}
   Link* GetPrev()const {return m_prev;}
   T* GetData()const {return m_data;}
   //setters
   void SetNext(Link* next) {m_next = next;}
   void SetPrev(Link* prev) {m_prev = prev;}
   void SetData(T* data) {m_data = data;}
  
  };
  
  error one: shadows template parm `class L'
  error two:declaration of `class L'
  error three: shadows template parm `class T'
  </code></pre>
  
  <p>i dont understand what is the problem. i can really use your help
  thank you :)</p>