[C++] Best Way to ++booleans?

From: entropy123 (email_entropy123_at_yahoo.com)
Date: 01/24/04


Date: 24 Jan 2004 11:16:31 -0800

Hey all,

Not sure if the question is quite right, but I would like to do the following.

Assign each node a color, say white.

Something happens to a node so I want to change its color to grey.

Another thing happens and I change its color to black.

And so on for all the nodes in the system.

I'd really like to do this as a 'boolean'.

say...

class Node() {

  bool IsBlack();
  bool IsWhite();
  bool IsGrey();

private
  int data;
  <????> color;
}

Any suggestions as to how to pull this off?

Thanks
ent



Relevant Pages