|
-
March 25th, 2004, 02:11 PM
#1
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|