tags:

views:

450

answers:

4

is there any tristate type in c++ stl?

A: 

No, your best bet is probably to define a custom class and overload all operators (operator&& etc).

Andy
+19  A: 

No, but there is boost tribool.

Dani van der Meer
tribool is handy, but it always annoyed me that the tribool default constructor constructed an instance with value false, rather than indeterminate.
timday
Right, that is possibly not the most logical default value. But you can always supply an initial value to the constructor.
Dani van der Meer
+4  A: 

You could also use a enumerated type with three values

1800 INFORMATION
+5  A: 

This site may help =P

http://thedailywtf.com/Articles/What_Is_Truth_0x3f_.aspx

Smashery