D
Dilip
Warning: Newbie clueless question.
I ran into something at work today that I solved by random hackery
without really understanding it. Can someone explain to me why the
template keyword is required at the callsite of this static template
function?
class foo
{
public:
template<typename T>
static void dosomethingtoT(T& value)
{
value = 44;
}
};
int main()
{
long l;
foo::template dosomethingtoT(l); // why the template keyword??
return 0;
}
I ran into something at work today that I solved by random hackery
without really understanding it. Can someone explain to me why the
template keyword is required at the callsite of this static template
function?
class foo
{
public:
template<typename T>
static void dosomethingtoT(T& value)
{
value = 44;
}
};
int main()
{
long l;
foo::template dosomethingtoT(l); // why the template keyword??
return 0;
}