tribool

Boost::tribool: odd behaviour, or bug?

I'm exploring boost::tribool and was surprised by the following behaviour. { using namespace boost; boost::tribool t(indeterminate); assert(t==indeterminate); // This assertion fails! } However, if I do this, the assert passes. assert(indeterminate(t)); No compiler warnings or errors in either case. Anyone have a good explanati...

C++ library with support for 3-valued logic: 0,1,X

I am working on a simulator for a microprocessor, written in C++. I am looking for a way to model state elements in the hardware that have just been powered up and have not yet been reset in any way. A real state element would have an unknown value that is either 0 or 1, but in software models this is commonly modeled as an X, meaning ...