C++ class nested into template class
<p>So I have some problems with my template class.</p>

<pre><code>&lt;!-- language: lang-c++ --&gt;

template&lt;class T&gt;
class List {
  class Counter
  {       
    T real;
    T imaginary;
    Counter *next;
 //....
  public:
    Counter(T a=0,T b=0);                  
    virtual ~Counter();                     
    friend ostream&amp; operator&lt;&lt;(ostream&amp;,Counter&amp;);
    friend ostream&amp; operator&lt;&lt;(ostream&amp;,List&amp;);
  };
  Counter* first;
  Counter* last;
//....
};
</code></pre>

<p>But I have some problems with methods. If i write function as</p>

<pre><code>template&lt;class T&gt; Counter operator/(Counter &amp;one,...)  
</code></pre>

<p>When I look at Counter in VC++10 it says something like</p>

<pre><code>&lt;error_type&gt;&amp;one
</code></pre>

<p>for example. Should I use <code>template&lt;class T&gt;</code> for my Counter class everywhere in the code?</p>

<pre><code>//Methods
//Counter. For example some methods
Counter operator/(Counter&amp; one,Counter&amp; two){}
ostream&amp; operator&lt;&lt;(ostream&amp;os,Counter&amp;x){}
istream&amp; operator&gt;&gt;(istream&amp;is,Counter&amp;x){}
 //List
template&lt;class T&gt;void List&lt;T&gt;::add(Counter *T,int i,bool c){}
</code></pre>
