using union and I need a ">" overloaded operator. How would I achieve this?

How would I achieve this. I keep getting errors. I tried to return bool values and then switched the return type on the overloaded function to bool but it still doesn't work.
E: why do you have 2 of the same threads? -_-

Im pretty sure like this

1
2
3
4
className className::operator>( leftNumber, rightNumber )
{
     return ( leftNumber > rightNumber ? leftNumber : rightNumber );
}
Last edited on
operator> is a boolean test. You should not alter it's behaviour! (to return anything apart from a bool)

Andy
Last edited on
oops.
Topic archived. No new replies allowed.