template and derived class definition : error: 'myClass' is not a class, namespace, or enumeration : <p>I'm trying to learn templates in C++ and I have the following code :</p>

<pre><code>#include &lt;stack&gt;

template&lt;typename T&gt;
class   myClass : public std::stack&lt;T&gt;{
public:
    myClass(void);
    myClass(myClass const &amp; src);
    virtual ~myClass(void);
    myClass &amp;   operator=(myClass const &amp; rhs);
};

template&lt;typename T&gt;
myClass::myClass(void) : std::stack&lt;T&gt;(){
}
</code></pre>

<p>But I can't figure out why I get the following when I try to compile :</p>

<pre><code>test.cpp:17:1: error: 'myClass' is not a class, namespace, or enumeration
myClass::myClass(void) : std::stack&lt;T&gt;(){
^
test.cpp:8:9: note: 'myClass' declared here
class   myClass : public std::stack&lt;T&gt;{
        ^
1 error generated.
</code></pre>

<p>It looks like the definition of the function causes the error, but I don't know why I get this error, it looks OK to me (even if I guess it's not really OK), just a syntax error perhaps?..</p>

<p>I compile with <strong>clang++ -Wall -Werror -Wextra -c</strong>.</p>

<p>What could cause this error?</p>
