dynamic_bitset 1.3.1
Simple Useful Libraries: C++17/20 header-only dynamic bitset
|
Reference to a sul::dynamic_bitset bit. More...
#include <sul/dynamic_bitset.hpp>
Public Member Functions | |
constexpr | reference (dynamic_bitset< Block, Allocator > &bitset, size_type bit_pos) |
Constructs a reference to a bit from a sul::dynamic_bitset and a bit position. | |
constexpr | reference (const reference &) noexcept=default |
Copy constructor. | |
constexpr | reference (reference &&) noexcept=default |
Move constructor. | |
~reference () noexcept=default | |
Destructor. | |
constexpr reference & | operator= (bool v) |
Assign a value to the referenced bit. | |
constexpr reference & | operator= (const reference &rhs) |
Assign a value to the referenced bit from another reference. | |
constexpr reference & | operator= (reference &&rhs) noexcept |
Assign a value to the referenced bit from another reference. | |
constexpr reference & | operator&= (bool v) |
Apply binary operator AND to the referenced bit and a value, and assign the result to the referenced bit. | |
constexpr reference & | operator|= (bool v) |
Apply binary operator OR to the referenced bit and a value, and assign the result to the referenced bit. | |
constexpr reference & | operator^= (bool v) |
Apply binary operator XOR to the referenced bit and a value, and assign the result to the referenced bit. | |
constexpr reference & | operator-= (bool v) |
Apply binary difference to the referenced bit and a value, and assign the result to the referenced bit. | |
constexpr bool | operator~ () const |
Return the result of applying unary NOT operator. | |
constexpr | operator bool () const |
bool conversion operator. | |
constexpr void | operator& ()=delete |
Deleted to avoid taking the address of a temporary proxy object. | |
constexpr reference & | set () |
Set the referenced bit to true. | |
constexpr reference & | reset () |
Reset the referenced bit to false. | |
constexpr reference & | flip () |
Flip the referenced bit. | |
constexpr reference & | assign (bool v) |
Assign the value v to the referenced bit. | |
Reference to a sul::dynamic_bitset bit.
As the bits in the sul::dynamic_bitset class are stored in an optimized way in blocks, it is not possible for the subscript operators to return a reference to a boolean. Hence this class is used as a proxy to enable subscript operator of the sul::dynamic_bitset class to be used as if it was an array of bools.
|
constexpr |
Constructs a reference to a bit from a sul::dynamic_bitset and a bit position.
bitset | sul::dynamic_bitset containing the bit | |
[in] | bit_pos | Position of the bit to reference in the sul::dynamic_bitset |
|
constexprdefaultnoexcept |
Copy constructor.
|
constexprdefaultnoexcept |
Move constructor.
|
defaultnoexcept |
Destructor.
|
constexpr |
Assign the value v
to the referenced bit.
[in] | v | Value to assign to the bit |
|
constexpr |
|
nodiscardconstexpr |
bool conversion operator.
|
constexprdelete |
Deleted to avoid taking the address of a temporary proxy object.
|
constexpr |
Apply binary operator AND to the referenced bit and a value, and assign the result to the referenced bit.
[in] | v | Value to apply binary operator AND with |
|
constexpr |
Apply binary difference to the referenced bit and a value, and assign the result to the referenced bit.
Equivalent to:
[in] | v | Value to apply binary difference with |
|
constexpr |
Assign a value to the referenced bit.
[in] | v | Value to assign to the referenced bit |
|
constexpr |
|
constexprnoexcept |
|
constexpr |
Apply binary operator XOR to the referenced bit and a value, and assign the result to the referenced bit.
[in] | v | Value to apply binary operator XOR with |
|
constexpr |
Apply binary operator OR to the referenced bit and a value, and assign the result to the referenced bit.
[in] | v | Value to apply binary operator OR with |
|
nodiscardconstexpr |
Return the result of applying unary NOT operator.
|
constexpr |
|
constexpr |