tetl 0.1.0
Embedded Template Library
|
#include <etl/bitset.hpp>
Classes | |
struct | reference |
Public Member Functions | |
constexpr | basic_bitset ()=default |
Default constructor. Constructs a bitset with all bits set to zero. | |
constexpr | basic_bitset (unsigned long long val) noexcept |
Constructs a bitset, initializing the first (rightmost, least significant) M bit positions to the corresponding bit values of val. | |
constexpr auto | all () const noexcept -> bool |
Checks if all bits are set to true. | |
constexpr auto | any () const noexcept -> bool |
Checks if any bits are set to true. | |
constexpr auto | count () const noexcept -> etl::size_t |
Returns the number of bits that are set to true. | |
constexpr auto | flip () noexcept -> basic_bitset & |
Flips all bits. | |
constexpr auto | none () const noexcept -> bool |
Checks if none of the bits are set to true. | |
constexpr auto | operator&= (basic_bitset const &other) noexcept -> basic_bitset & |
Sets the bits to the result of binary AND on corresponding pairs of bits of *this and other | |
constexpr auto | operator[] (etl::size_t pos) -> reference |
Returns a reference to the bit at position pos . | |
constexpr auto | operator[] (etl::size_t pos) const -> bool |
Returns true if the bit at position pos is set. | |
constexpr auto | operator^= (basic_bitset const &other) noexcept -> basic_bitset & |
Sets the bits to the result of binary XOR on corresponding pairs of bits of *this and other | |
constexpr auto | operator|= (basic_bitset const &other) noexcept -> basic_bitset & |
Sets the bits to the result of binary OR on corresponding pairs of bits of *this and other | |
constexpr auto | reset () noexcept -> basic_bitset & |
Sets all bits to false. | |
constexpr auto | set () noexcept -> basic_bitset & |
Sets all bits to true. | |
constexpr auto | size () const noexcept -> etl::size_t |
Returns the number of bits that the bitset holds. | |
constexpr auto | unchecked_flip (etl::size_t pos) -> basic_bitset & |
Flip bit at position pos . | |
constexpr auto | unchecked_reset (etl::size_t pos) -> basic_bitset & |
Sets the bit at position pos to false. | |
constexpr auto | unchecked_set (etl::size_t pos, bool value=true) -> basic_bitset & |
Set bit at position pos to value . | |
constexpr auto | unchecked_test (etl::size_t pos) const -> bool |
Returns true if the bit at position pos is set. | |
Friends | |
constexpr auto | operator& (basic_bitset const &lhs, basic_bitset const &rhs) noexcept -> basic_bitset |
Returns a basic_bitset containing the result of binary AND on corresponding pairs of bits of lhs and rhs . | |
constexpr auto | operator== (basic_bitset const &lhs, basic_bitset const &rhs) -> bool=default |
Returns true if all of the bits in lhs and rhs are equal. | |
constexpr auto | operator^ (basic_bitset const &lhs, basic_bitset const &rhs) noexcept -> basic_bitset |
Returns a basic_bitset containing the result of binary XOR on corresponding pairs of bits of lhs and rhs . | |
constexpr auto | operator| (basic_bitset const &lhs, basic_bitset const &rhs) noexcept -> basic_bitset |
Returns a basic_bitset containing the result of binary OR on corresponding pairs of bits of lhs and rhs . | |
|
constexprdefault |
Default constructor. Constructs a bitset with all bits set to zero.
|
inlineconstexprnoexcept |
Constructs a bitset, initializing the first (rightmost, least significant) M bit positions to the corresponding bit values of val.
|
inlinenodiscardconstexprnoexcept |
Checks if all bits are set to true.
|
inlinenodiscardconstexprnoexcept |
Checks if any bits are set to true.
|
inlinenodiscardconstexprnoexcept |
Returns the number of bits that are set to true.
|
inlineconstexprnoexcept |
Flips all bits.
|
inlinenodiscardconstexprnoexcept |
Checks if none of the bits are set to true.
|
inlineconstexprnoexcept |
Sets the bits to the result of binary AND on corresponding pairs of bits of *this
and other
|
inlinenodiscardconstexpr |
Returns a reference to the bit at position pos
.
pos < size()
|
inlinenodiscardconstexpr |
Returns true if the bit at position pos
is set.
pos < size()
|
inlineconstexprnoexcept |
Sets the bits to the result of binary XOR on corresponding pairs of bits of *this
and other
|
inlineconstexprnoexcept |
Sets the bits to the result of binary OR on corresponding pairs of bits of *this
and other
|
inlineconstexprnoexcept |
Sets all bits to false.
|
inlineconstexprnoexcept |
Sets all bits to true.
|
inlinenodiscardconstexprnoexcept |
Returns the number of bits that the bitset holds.
|
inlineconstexpr |
Flip bit at position pos
.
pos < size()
|
inlineconstexpr |
Sets the bit at position pos
to false.
pos < size()
|
inlineconstexpr |
Set bit at position pos
to value
.
pos < size()
|
inlinenodiscardconstexpr |
Returns true if the bit at position pos
is set.
pos < size()
|
friend |
Returns a basic_bitset containing the result of binary AND on corresponding pairs of bits of lhs
and rhs
.
|
friend |
Returns true if all of the bits in lhs
and rhs
are equal.
|
friend |
Returns a basic_bitset containing the result of binary XOR on corresponding pairs of bits of lhs
and rhs
.
|
friend |
Returns a basic_bitset containing the result of binary OR on corresponding pairs of bits of lhs
and rhs
.