22 #ifndef STATICLIB_SUPPORT_TRIBOOL_HPP
23 #define STATICLIB_SUPPORT_TRIBOOL_HPP
25 namespace staticlib {
namespace support {
namespace logic {
83 typedef void (dummy::*safe_bool)();
115 operator safe_bool()
const
204 if (static_cast<bool>(!x) || static_cast<bool>(!y))
206 else if (static_cast<bool>(x) && static_cast<bool>(y))
216 {
return y? x :
tribool(
false); }
222 {
return x? y :
tribool(
false); }
271 if (static_cast<bool>(!x) && static_cast<bool>(!y))
273 else if (static_cast<bool>(x) || static_cast<bool>(y))
283 {
return y?
tribool(
true) : x; }
289 {
return x?
tribool(
true) : y; }
342 return (x && y) || (!x && !y);
405 return !((x && y) || (!x && !y));
433 namespace staticlib {
namespace support {
434 using logic::tribool;
455 #define STATICLIB_HTTPSERVER_TRIBOOL_THIRD_STATE(Name) \
457 Name(staticlib::support::logic::tribool x, \
458 staticlib::support::logic::detail::indeterminate_t = \
459 staticlib::support::logic::detail::indeterminate_t()) \
460 { return x.value == staticlib::support::logic::tribool::indeterminate_value; }
462 #endif // STATICLIB_SUPPORT_TRIBOOL_HPP