• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Operator << is ambiguous

morulis

Member
The following code plays well in Visual Studio 2003 but not in Visual Studio 6. Can you tell me
why? Is a bug of the compiler?
#include <iostream>
using namespace std;
class hello
{
friend ostream& operator << (ostream& s, hello& h);
};
ostream& operator <<(ostream& s, hello& h)
{
s<<"hello world";
return s;
}

void main()
{
cout<<hello();
}
 
Back
Top