* 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;
> }
This is due to using a very old compiler, alternatively perhaps AIX
compiler.
The above compiles fine sans 'template' keyword with MSVC 7.1, g++ 3.4.4
and Comeau Online 4.3.3.
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
|