29#ifndef _GLIBCXX_TR2_BOOL_SET
30#define _GLIBCXX_TR2_BOOL_SET 1
33#pragma GCC system_header
39namespace 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>
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];
208 contains(bool_set __s, bool_set __t)
209 {
return __s.contains(__t); }
212 equals(bool_set __s, bool_set __t)
213 {
return __s.equals(__t); }
216 is_emptyset(bool_set __b)
217 {
return __b.is_emptyset(); }
220 is_indeterminate(bool_set __b)
221 {
return __b.is_indeterminate(); }
224 is_singleton(bool_set __b)
225 {
return __b.is_singleton(); }
228 certainly(bool_set __b)
229 {
return ! __b.contains(
false); }
232 possibly(bool_set __b)
233 {
return __b.contains(
true); }
239 set_union(
bool __s, bool_set __t)
240 {
return bool_set(__s) | __t; }
243 set_union(bool_set __s,
bool __t)
244 {
return __s | bool_set(__t); }
247 set_union(bool_set __s, bool_set __t)
248 {
return __s | __t; }
251 set_intersection(
bool __s, bool_set __t)
252 {
return bool_set(__s) & __t; }
255 set_intersection(bool_set __s,
bool __t)
256 {
return __s & bool_set(__t); }
259 set_intersection(bool_set __s, bool_set __t)
260 {
return __s & __t; }
263 set_complement(bool_set __b)
271 {
return bool_set(__s) ^ __t; }
275 {
return __s ^ bool_set(__t); }
279 {
return bool_set(__s) | __t; }
283 {
return __s | bool_set(__t); }
287 {
return bool_set(__s) & __t; }
291 {
return __s & bool_set(__t); }
297 operator==(
bool __s, bool_set __t)
298 {
return bool_set(__s) == __t; }
301 operator==(bool_set __s,
bool __t)
302 {
return __s == bool_set(__t); }
305 operator!=(
bool __s, bool_set __t)
306 {
return ! (__s == __t); }
309 operator!=(bool_set __s,
bool __t)
310 {
return ! (__s == __t); }
313 operator!=(bool_set __s, bool_set __t)
314 {
return ! (__s == __t); }
317_GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
constexpr bitset< _Nb > operator^(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
constexpr bitset< _Nb > operator|(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
constexpr bitset< _Nb > operator&(const bitset< _Nb > &__x, const bitset< _Nb > &__y) noexcept
Global bitwise operations on bitsets.
Thrown during incorrect typecasting.
Template class basic_istream.
Template class basic_ostream.
constexpr bool_set()
Default constructor.
bool equals(bool_set __b) const
Return true if states are equal.
bool is_indeterminate() const
Return true if this is indeterminate.
bool is_emptyset() const
Return true if this is empty.
bool is_singleton() const
Return true if this is false or true (normal boolean).
constexpr bool_set(bool __t)
Constructor from bool.