Original Post
Hi, i am new to templates and i cant get my first function template working. Here is the code:
#include <iostream.h>
class a {
public:
template <class T> void function(T arg);
};
template <class T> void a::function(T arg) {
cout << arg;
}
int main() {
a A;
A.function(5);
return 0;
}
I guess that the error is in declaration of function() but i dont know what is the correct way. Compiler tells me that it failed to specialize function template 'void __thiscall a::function(T)'
[edited by - stezka on July 20, 2003 12:07:05 PM]
