Sign in to follow this  
spacekid434

Error C2593

Recommended Posts

spacekid434    117
Hey guys.

I am doing the last program in beginning c++ though game programming and i have come across a compile error (in title). D=

The error is "error C2593: 'operator <<' is ambiguous"

here is the function that the error is in. I hope this enough to help but if its not i will most more later. This is a friend function to a class (GenericPlayer)
[code]ostream& operator<<(ostream& os, const GenericPlayer& aGenericPlayer){
os << aGenericPlayer.m_Name << ":\t";

vector<Card*>::const_iterator pCard;
if(!aGenericPlayer.m_Cards.empty()){
for(pCard = aGenericPlayer.m_Cards.begin(); pCard != aGenericPlayer.m_Cards.end(); ++pCard){
os << *(*pCard) << "\t"; // this is the line of code with the error. It is the first << operator
}
if(aGenericPlayer.GetTotal() != 0){
cout << "(" << aGenericPlayer.GetTotal() << ")";
}
}
else{
os << "<empty>";
}
return os;
}[/code]


Thanks for the help
spacekid434

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this