Define template in header file and definition in a cpp file within derived class
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3749099/why-should-the-implementation-and-the-declaration-of-a-template-class-be-in-the">Why should the implementation and the declaration of a template class be in the same header file?</a>  </p>
</blockquote>



<p>I am trying to define a template in a header file and the definition of it in a cpp file and the template should be defined within a derived class. So this is what I got: </p>

<p><strong>Header file:</strong></p>

<pre><code>#ifndef  ........
#define .....
 template &lt;class mytypename&gt;
 class abcBaseClass:public abcDerivedClass{
 public:
     mytypename getvalue(char*)
};
#endif
</code></pre>

<p><br>
<strong>Source file:</strong></p>

<pre><code>mytypename abcDerivedClass&lt;mytypename&gt;::getvalue(char* name){

}
</code></pre>

<p>I just wanted to know if this is the correct way of doing it?.</p>

<p>This is what I am trying to achieve... The final way I want to make the call is </p>

<pre><code>double x = a-&gt;getvalue&lt;double&gt;(char)
</code></pre>
