Sign in to follow this  

Error C2593

This topic is 2335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

This topic is 2335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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