29 #ifndef _GLIBCXX_TR2_BOOL_SET
30 #define _GLIBCXX_TR2_BOOL_SET 1
32 #pragma GCC system_header
37 namespace std _GLIBCXX_VISIBILITY(default)
41 _GLIBCXX_BEGIN_NAMESPACE_VERSION
62 constexpr
bool_set(
bool __t) : _M_b(_Bool_set_val(__t)) { }
70 {
return __b._M_b == _M_b; }
74 {
return _M_b == _S_empty; }
78 {
return _M_b == _S_indet; }
82 {
return _M_b == _S_false || _M_b == _S_true_; }
111 {
return __b._M_not(); }
115 {
return __s._M_xor(__t); }
119 {
return __s._M_or(__t); }
123 {
return __s._M_and(__t); }
127 {
return __s._M_eq(__t); }
132 template<
typename CharT,
typename Traits>
134 operator<<(std::basic_ostream<CharT, Traits>& __out,
bool_set __b)
140 template<
typename CharT,
typename Traits>
146 if (__c >= _S_false && __c < _S_empty)
147 __b._M_b =
static_cast<_Bool_set_val
>(__c);
153 enum _Bool_set_val:
unsigned char
165 bool_set(_Bool_set_val __c) : _M_b(__c) { }
169 {
return _S_not[this->_M_b]; }
173 {
return _S_xor[this->_M_b][__b._M_b]; }
177 {
return _S_or[this->_M_b][__b._M_b]; }
181 {
return _S_and[this->_M_b][__b._M_b]; }
185 {
return _S_eq[this->_M_b][__b._M_b]; }
188 static _Bool_set_val _S_not[4];
191 static _Bool_set_val _S_xor[4][4];
194 static _Bool_set_val _S_or[4][4];
197 static _Bool_set_val _S_and[4][4];
200 static _Bool_set_val _S_eq[4][4];
206 contains(bool_set __s, bool_set __t)
207 {
return __s.contains(__t); }
210 equals(bool_set __s, bool_set __t)
211 {
return __s.equals(__t); }
214 is_emptyset(bool_set __b)
215 {
return __b.is_emptyset(); }
218 is_indeterminate(bool_set __b)
219 {
return __b.is_indeterminate(); }
222 is_singleton(bool_set __b)
223 {
return __b.is_singleton(); }
226 certainly(bool_set __b)
227 {
return ! __b.contains(
false); }
230 possibly(bool_set __b)
231 {
return __b.contains(
true); }
237 set_union(
bool __s, bool_set __t)
238 {
return bool_set(__s) | __t; }
241 set_union(bool_set __s,
bool __t)
242 {
return __s | bool_set(__t); }
245 set_union(bool_set __s, bool_set __t)
246 {
return __s | __t; }
249 set_intersection(
bool __s, bool_set __t)
250 {
return bool_set(__s) & __t; }
253 set_intersection(bool_set __s,
bool __t)
254 {
return __s & bool_set(__t); }
257 set_intersection(bool_set __s, bool_set __t)
258 {
return __s & __t; }
261 set_complement(bool_set __b)
269 {
return bool_set(__s) ^ __t; }
273 {
return __s ^ bool_set(__t); }
277 {
return bool_set(__s) | __t; }
281 {
return __s | bool_set(__t); }
285 {
return bool_set(__s) & __t; }
289 {
return __s & bool_set(__t); }
295 operator==(
bool __s, bool_set __t)
296 {
return bool_set(__s) == __t; }
299 operator==(bool_set __s,
bool __t)
300 {
return __s == bool_set(__t); }
303 operator!=(
bool __s, bool_set __t)
304 {
return ! (__s == __t); }
307 operator!=(bool_set __s,
bool __t)
308 {
return ! (__s == __t); }
311 operator!=(bool_set __s, bool_set __t)
312 {
return ! (__s == __t); }
314 _GLIBCXX_END_NAMESPACE_VERSION
320 #endif // _GLIBCXX_TR2_BOOL_SET
bool is_emptyset() const
Return true if this is empty.
bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
Template class basic_istream.
bool is_singleton() const
Return true if this is false or true (normal boolean).
constexpr bool_set()
Default constructor.
constexpr bool_set(bool __t)
Constructor from bool.
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.
bool is_indeterminate() const
Return true if this is indeterminate.
bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
Template class basic_ostream.
bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.