In C++ you can have a three-valued `bool` which has a value that is both true and false:
```
#include <iostream>

enum bool_
{
false_ = 1,
true_ = 2,
};

inline bool_ operator|(bool_ b1, bool_ b2)
{
return static_cast<bool_>(static_cast<int>(b1) | static_cast<int>(b2));
}

int main(){
// prints 3
std::cout << (true_ | false_) << std::endl;
}
```

Follow

@boarders why are you re-implementing boost::logic::tribool! Its the same functionality, but slightly non-intuitive.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.