• Advertisement
Sign in to follow this  

Error C2593

This topic is 2410 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)
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;
}



Thanks for the help
spacekid434

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement