29 #ifndef _GLIBCXX_TR2_BOOL_SET 30 #define _GLIBCXX_TR2_BOOL_SET 1 32 #ifdef _GLIBCXX_SYSHDR 33 #pragma GCC system_header 39 namespace std _GLIBCXX_VISIBILITY(default)
41 _GLIBCXX_BEGIN_NAMESPACE_VERSION
64 constexpr
bool_set(
bool __t) : _M_b(_Bool_set_val(__t)) { }
72 {
return __b._M_b == _M_b; }
76 {
return _M_b == _S_empty; }
80 {
return _M_b == _S_indet; }
84 {
return _M_b == _S_false || _M_b == _S_true_; }
113 {
return __b._M_not(); }
117 {
return __s._M_xor(__t); }
121 {
return __s._M_or(__t); }
125 {
return __s._M_and(__t); }
129 {
return __s._M_eq(__t); }
134 template<
typename CharT,
typename Traits>
136 operator<<(std::basic_ostream<CharT, Traits>& __out,
bool_set __b)
142 template<
typename CharT,
typename Traits>
148 if (__c >= _S_false && __c < _S_empty)
149 __b._M_b =
static_cast<_Bool_set_val
>(__c);
155 enum _Bool_set_val:
unsigned char 167 bool_set(_Bool_set_val __c) : _M_b(__c) { }
171 {
return _S_not[this->_M_b]; }
175 {
return _S_xor[this->_M_b][__b._M_b]; }
179 {
return _S_or[this->_M_b][__b._M_b]; }
183 {
return _S_and[this->_M_b][__b._M_b]; }
187 {
return _S_eq[this->_M_b][__b._M_b]; }
190 static _Bool_set_val _S_not[4];
193 static _Bool_set_val _S_xor[4][4];
196 static _Bool_set_val _S_or[4][4];
199 static _Bool_set_val _S_and[4][4];
202 static _Bool_set_val _S_eq[4][4];
209 {
return __s.contains(__t); }
213 {
return __s.
equals(__t); }
229 {
return ! __b.contains(
false); }
233 {
return __b.contains(
true); }
248 {
return __s | __t; }
251 set_intersection(
bool __s,
bool_set __t)
255 set_intersection(
bool_set __s,
bool __t)
260 {
return __s & __t; }
306 {
return ! (__s == __t); }
310 {
return ! (__s == __t); }
314 {
return ! (__s == __t); }
317 _GLIBCXX_END_NAMESPACE_VERSION
322 #endif // _GLIBCXX_TR2_BOOL_SET bool is_emptyset() const
Return true if this is empty.
constexpr bitset< _Nb > operator &(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
bool is_indeterminate() const
Return true if this is indeterminate.
Template class basic_ostream.
ISO C++ entities toplevel namespace is std.
bool is_singleton() const
Return true if this is false or true (normal boolean).
bool equals(bool_set __b) const
Return true if states are equal.
Thrown during incorrect typecasting.If you attempt an invalid dynamic_cast expression, an instance of this class (or something derived from this class) is thrown.
constexpr bool_set(bool __t)
Constructor from bool.
Template class basic_istream.
constexpr bool_set()
Default constructor.