---
name: "std::tr2::bool_set"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::tr2::bool_set/3cxx"
---

# std::tr2::bool\_set(3cxx)

## NAME

std::tr2::bool\_set

## SYNOPSIS

`#include <bool_set>`

### Public Member Functions

constexpr **bool\_set** ()\
 Default constructor.  constexpr **bool\_set** (bool \_\_t)\
 Constructor from bool.  bool **contains** (**bool\_set** \_\_b) const\
 bool **equals** (**bool\_set** \_\_b) const\
 Return true if states are equal.  bool **is\_emptyset** () const\
 Return true if this is empty.  bool **is\_indeterminate** () const\
 Return true if this is indeterminate.  bool **is\_singleton** () const\
 Return true if this is false or true (normal boolean).  **operator bool** () const\
 Conversion to bool.

### Static Public Member Functions

**static** **bool\_set** **emptyset** ()\
 **static** **bool\_set** **indeterminate** ()\

### Friends

**bool\_set** **operator!** (**bool\_set** \_\_b)\
 **bool\_set** **operator&** (**bool\_set** **\_\_s**, **bool\_set** \_\_t)\
 template\<**typename** **CharT** , **typename** **Traits** \> **std::basic\_ostream**\< **CharT**, **Traits** \> & **operator\<\<** (**std::basic\_ostream**\< **CharT**, **Traits** \> &**\_\_out**, **bool\_set** \_\_b)\
 **bool\_set** **operator==** (**bool\_set** **\_\_s**, **bool\_set** \_\_t)\
 template\<**typename** **CharT** , **typename** **Traits** \> **std::basic\_istream**\< **CharT**, **Traits** \> & **operator\>\>** (**std::basic\_istream**\< **CharT**, **Traits** \> &**\_\_in**, **bool\_set** &\_\_b)\
 **bool\_set** **operator^** (**bool\_set** **\_\_s**, **bool\_set** \_\_t)\
 **bool\_set** **operator\|** (**bool\_set** **\_\_s**, **bool\_set** \_\_t)\

## Detailed Description

bool\_set

See N2136, Bool\_set: multi-valued logic by Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion.

The implicit conversion to bool is slippery! I may use the new explicit conversion. This has been specialized in the language so that in contexts requiring a bool the conversion happens implicitly. Thus most objections should be eliminated.

## Constructor & Destructor Documentation

### constexpr std::tr2::bool\_set::bool\_set ()` [inline]`, ` [constexpr]`

Default constructor.

### constexpr std::tr2::bool\_set::bool\_set (bool \_\_t)` [inline]`, ` [constexpr]`

Constructor from bool.

## Member Function Documentation

### bool std::tr2::bool\_set::equals (bool\_set \_\_b) const` [inline]`

Return true if states are equal.

### bool std::tr2::bool\_set::is\_emptyset () const` [inline]`

Return true if this is empty.

### bool std::tr2::bool\_set::is\_indeterminate () const` [inline]`

Return true if this is indeterminate.

### bool std::tr2::bool\_set::is\_singleton () const` [inline]`

Return true if this is false or true (normal boolean).

### std::tr2::bool\_set::operator bool () const` [inline]`

Conversion to bool.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
