Hi,
I want to use function template, and did something like this :
class Test
{
public:
template<class T>
void foo ()
{
}
};
int main ()
{
Test t;
t.foo<int> ();
return 0;
}
When compiling with VC++ 6.0, I get :
error C2062: type 'int' unexpected
But there are no compilation errors with g++.
Apparently, VC++ compiler does not understand explicit function template arguments.
How can I work around this problem?
--
Globos
I want to use function template, and did something like this :
class Test
{
public:
template<class T>
void foo ()
{
}
};
int main ()
{
Test t;
t.foo<int> ();
return 0;
}
When compiling with VC++ 6.0, I get :
error C2062: type 'int' unexpected
But there are no compilation errors with g++.
Apparently, VC++ compiler does not understand explicit function template arguments.
How can I work around this problem?
--
Globos