Mail Archives: djgpp/1997/05/15/09:33:34
> : This is my problem : this simple class doesn't compile !
> : WHY!??? ... :-<<<<
> : template <class T> myclass<T>::myclass(T tinf)
> : {
> : cout << "Hello World!" << endl;
> : inf = tinf;
> : }
> you need to specify a type that the function is going to return.
> template <class T>
> void myclass<T>::myclass(T tinf)
> ^^^^
> like that
Wrong, by omitting the void, the function would default to returning an
int. Now, I don't remember what the rest of the template code looks
like, but I'd bet it's an instantiation problem. I'd go back and look
except I already deleted the original message.
- Raw text -