Operator template specialization
[Sorry for posting this accidentally over in the graphics forum. It should be in this forum.]
Can anyone tell me why the following code compiles under GCC but not with MSVC? MSVC cannot parse the code properly.
class Foo
{
};
template<typename T1> void operator<<(Foo&, T1){}
template<> void operator<< <int>(Foo&, int){}
It says "error C2143: syntax error : missing ';' before '<'" Thus, it is failing to parse the <int> after the << operator. GCC has no problem with it.