sparrow 0.9.0
|
A proxy reference class that provides mutable access to individual bits in a bitset. More...
#include <bitset_reference.hpp>
Public Types | |
using | self_type = bitset_reference<B> |
This class type for convenience. | |
Public Member Functions | |
constexpr | bitset_reference (const bitset_reference &) noexcept=default |
constexpr | bitset_reference (bitset_reference &&) noexcept=default |
constexpr self_type & | operator= (const self_type &rhs) noexcept |
Copy assignment from another bitset_reference. | |
constexpr self_type & | operator= (self_type &&rhs) noexcept |
Move assignment from another bitset_reference. | |
constexpr self_type & | operator= (bool value) noexcept |
Assignment from a boolean value. | |
constexpr | operator bool () const noexcept |
Implicit conversion to bool. | |
constexpr bool | operator~ () const noexcept |
Bitwise NOT operator. | |
constexpr self_type & | operator&= (bool rhs) noexcept |
Bitwise AND assignment. | |
constexpr self_type & | operator|= (bool rhs) noexcept |
Bitwise OR assignment. | |
constexpr self_type & | operator^= (bool rhs) noexcept |
Bitwise XOR assignment. | |
Friends | |
class | bitset_iterator< B, false > |
Mutable iterator needs access to create references. | |
template<typename RAR> | |
class | dynamic_bitset_base |
Bitset base class needs access to create references. | |
A proxy reference class that provides mutable access to individual bits in a bitset.
This class acts as a smart reference that allows individual bits in a bitset to be treated as if they were regular boolean references, despite being stored as packed bits within integer blocks. It provides a complete set of boolean operations and assignment operators to make bit manipulation transparent to the user.
The reference maintains a pointer to the owning bitset and the index of the bit it represents. All operations are forwarded to the appropriate bitset methods, ensuring that null count tracking and other internal state remain consistent.
B | The bitset type that contains the referenced bit. Must be a type that provides test() and set() methods with appropriate signatures. |
Example usage:
Definition at line 56 of file bitset_reference.hpp.
using sparrow::bitset_reference< B >::self_type = bitset_reference<B> |
This class type for convenience.
Definition at line 60 of file bitset_reference.hpp.
|
constexprdefaultnoexcept |
|
constexprdefaultnoexcept |
|
constexprnoexcept |
Implicit conversion to bool.
Definition at line 227 of file bitset_reference.hpp.
|
constexprnoexcept |
Bitwise AND assignment.
rhs | The boolean value to AND with the referenced bit |
Definition at line 239 of file bitset_reference.hpp.
|
constexprnoexcept |
Assignment from a boolean value.
value | The boolean value to assign to the referenced bit |
Definition at line 220 of file bitset_reference.hpp.
|
constexprnoexcept |
Copy assignment from another bitset_reference.
rhs | The reference to copy the value from |
Definition at line 206 of file bitset_reference.hpp.
|
constexprnoexcept |
Move assignment from another bitset_reference.
rhs | The reference to move the value from |
Definition at line 213 of file bitset_reference.hpp.
|
constexprnoexcept |
Bitwise XOR assignment.
rhs | The boolean value to XOR with the referenced bit |
Definition at line 259 of file bitset_reference.hpp.
|
constexprnoexcept |
Bitwise OR assignment.
rhs | The boolean value to OR with the referenced bit |
Definition at line 249 of file bitset_reference.hpp.
|
constexprnoexcept |
Bitwise NOT operator.
Definition at line 233 of file bitset_reference.hpp.
|
friend |
Mutable iterator needs access to create references.
Definition at line 174 of file bitset_reference.hpp.
Bitset base class needs access to create references.
Definition at line 179 of file bitset_reference.hpp.