c++ template confusions
<p>I am writing some code using template,but i got some link errors:</p>

<blockquote>
  <p>[Linker error] undefined reference to `Vector::Vector(Vector const&amp;)' </p>
</blockquote>

<p>But i wrote this function in a .cpp.Here is the code.</p>

<pre><code>template &lt;class T&gt;

Vector&lt;T&gt;::Vector(Vector const&amp; r)
{


m_nSize = r.size();
int i = 0;
m_pElements = new T[m_nSize];
    while(i &lt;= m_nSize)
{
    m_pElements[i] = r[i];
    i++;
}
}
</code></pre>

<p>and it is declared here in .h:</p>

<pre><code>template &lt;class T&gt;

class Vector
{

public:

Vector():m_nSize(0){ m_pElements = (T*)NULL; }
Vector(int size):m_nSize(size){ m_pElements = new T[size]; }
Vector(const Vector&amp; r);
virtual ~Vector(){ delete m_pElements; }
T&amp; operator[](int index){ return m_pElements[index];}
int size(){return m_nSize;}
int inflate(int addSize);
private:

    T *m_pElements;
    int m_nSize;
};
</code></pre>

<p>I'm really confused now...What should i do to correct is?</p>
