"desktop" <ff*@sss.comwrote in message
news:f1**********@news.net.uni-c.dk...
Zeppe wrote:
>desktop wrote:
>>When I try to compile this template:
template <typename T>
class ElementT<std::vector<T {
public:
typedef T Type; };
I get the error:
main.cpp:11: error: ‘ElementT’ is not a template
make: *** [main.o] Error 1
What is causing this error?
What is std::vector<T>? What are you trying to do?
The correct template declaration is:
template <typename T>
class ElementT{
public:
typedef T Type;
};
Regards,
Zeppe
It works if I first type:
template <typename T>
class ElementT;
and then the partial specialization:
template <typename T>
class ElementT<std::vector<T {
public:
typedef T Type; };
It seems that when doing partial specialization you first need to define
the class as a template.
That is correct, although you have "definition" and "declaration" mixed up.
You are trying to *define* a partial specialization without first
*declaring* the general template, which is an error.
- Sylvester Hesp