bitset_ref class
#include <bn_bitset.h>
ibitset implementation which manages an external elements array.
Base classes
- class ibitset
- Base class of bn::
bitset.
Constructors, destructors, conversion operators
-
template<int ElementSize>bitset_ref(element_
t(&elements_array_ref)[ElementSize]) constexpr - Constructor.
-
bitset_ref(span<element_
t> elements_ref) constexpr - Constructor.
-
bitset_ref(bitset_
ref&& other) constexpr noexcept - Move constructor.
Public functions
-
auto operator=(const ibitset& other) -> bitset_
ref& constexpr - Copy assignment operator.
-
auto set() -> bitset_
ref& constexpr - Sets all bits to
true. -
auto set(int index) -> bitset_
ref& constexpr - Sets the specified bit to
true. -
auto set(int index,
bool value) -> bitset_
ref& constexpr - Sets the specified bit to the specified value.
-
auto reset() -> bitset_
ref& constexpr - Sets all bits to
false. -
auto reset(int index) -> bitset_
ref& constexpr - Sets the specified bit to
false. -
auto flip() -> bitset_
ref& constexpr - Flips all values (changes
truevalues tofalseand vice versa). -
auto flip(int index) -> bitset_
ref& constexpr - Flips the specified bit value (changes
truevalue tofalseand vice versa). -
auto operator&=(const ibitset& other) -> bitset_
ref& constexpr - Sets the bits to the result of binary AND of this ibitset and the given one.
-
auto operator|=(const ibitset& other) -> bitset_
ref& constexpr - Sets the bits to the result of binary OR of this ibitset and the given one.
-
auto operator^=(const ibitset& other) -> bitset_
ref& constexpr - Sets the bits to the result of binary XOR of this ibitset and the given one.
Function documentation
template<int ElementSize>
bn:: bitset_ref:: bitset_ref(element_ t(&elements_array_ref)[ElementSize]) constexpr
Constructor.
| Parameters | |
|---|---|
| elements_array_ref | Elements array reference. |
The elements are not copied but referenced, so they should outlive the bitset_
bn:: bitset_ref:: bitset_ref(span<element_ t> elements_ref) constexpr
Constructor.
| Parameters | |
|---|---|
| elements_ref | Elements reference. |
The elements are not copied but referenced, so they should outlive the bitset_
bn:: bitset_ref:: bitset_ref(bitset_ ref&& other) constexpr noexcept
Move constructor.
| Parameters | |
|---|---|
| other | bitset_ |
bitset_ ref& bn:: bitset_ref:: operator=(const ibitset& other) constexpr
Copy assignment operator.
| Parameters | |
|---|---|
| other | ibitset to copy. |
| Returns | Reference to this. |
bitset_ ref& bn:: bitset_ref:: set(int index) constexpr
Sets the specified bit to true.
| Parameters | |
|---|---|
| index | Index of the bit to set. |
| Returns | Reference to this. |
bitset_ ref& bn:: bitset_ref:: set(int index,
bool value) constexpr
Sets the specified bit to the specified value.
| Parameters | |
|---|---|
| index | Index of the bit to set. |
| value | Value to set. |
| Returns | Reference to this. |
bitset_ ref& bn:: bitset_ref:: reset(int index) constexpr
Sets the specified bit to false.
| Parameters | |
|---|---|
| index | Index of the bit to set. |
| Returns | Reference to this. |
bitset_ ref& bn:: bitset_ref:: flip() constexpr
Flips all values (changes true values to false and vice versa).
| Returns | Reference to this. |
|---|
bitset_ ref& bn:: bitset_ref:: flip(int index) constexpr
Flips the specified bit value (changes true value to false and vice versa).
| Parameters | |
|---|---|
| index | Index of the bit to flip. |
| Returns | Reference to this. |
bitset_ ref& bn:: bitset_ref:: operator&=(const ibitset& other) constexpr
Sets the bits to the result of binary AND of this ibitset and the given one.
| Parameters | |
|---|---|
| other | Another ibitset. |
| Returns | Reference to this. |
bitset_ ref& bn:: bitset_ref:: operator|=(const ibitset& other) constexpr
Sets the bits to the result of binary OR of this ibitset and the given one.
| Parameters | |
|---|---|
| other | Another ibitset. |
| Returns | Reference to this. |
bitset_ ref& bn:: bitset_ref:: operator^=(const ibitset& other) constexpr
Sets the bits to the result of binary XOR of this ibitset and the given one.
| Parameters | |
|---|---|
| other | Another ibitset. |
| Returns | Reference to this. |