I'm programming a connect four game and I ran into an interesting question which I haven't seen addressed anywhere. Say I have an object called board which stores a board position among other things. Now, say I want to check to see if somebody has four in a row, obviously I could use a member function like board.checkIfWon(), but is there any way to do something like this:
Code:
if (board)
   // somebody won

*OR*

if (!board)
   // keep playing
Any way to overload anything to accomplish this? Not saying this is the best or easiest way to go, I was just curious if it was possible.