I am trying to implement the Tribool type using http://www.boost.org/doc/libs/1_41_0/doc/html/tribool.html as a reference.
I use structure as it is a primitive type and should not be extensible. I know that there are three types of Tribools: True, False, and Unknown, and the default constructor should provide a False Tribool. My question is: what data type do I set to True, False, and Unknown to? Right now I have:
struct Tribool
{
public static readonly Tribool TRUE, FALSE, UNKNOWN;
public Tribool()
{
Tribool = FALSE;
}
but I'm not sure if this is correct, since it looks like I'm just installing Tribool for another Tribool. Should I use ValueType instead? It appeared when I was typing on VS, and that sounds reasonable, but I could not find much information about this from Google.
, Tribool bools, , "true" "false" . ? , bool?
!
: , , . bools, , .