pasta_bit_vector
1.0.1
Bit Vector with Compact and Fast Rank and Select Support
|
Utility class used for the access operator of the BitVector
.
More...
#include <bit_vector.hpp>
Public Member Functions | |
BitAccess ()=delete | |
Deleted constructor. | |
BitAccess (BitAccess &&)=delete | |
Avoiding implicit generation of the move constructor. | |
BitAccess & | operator= (BitAccess const &)=delete |
Avoiding implicit copy assignment. | |
BitAccess & | operator= (BitAccess &&)=delete |
Avoiding implicit move assignment. | |
BitAccess (uint64_t *const data, size_t const position) noexcept | |
Constructor setting 64-bit word and position of the bit in the word. | |
operator bool () const noexcept | |
User-defined conversion function to bool. | |
BitAccess & | operator= (bool const value) noexcept |
Assignment operator to set a bit within the bit vector. | |
int64_t | distance (BitAccess const &other) const noexcept |
Computes the distance to another BitAccess instance. | |
Friends | |
class | BitVector |
Forward declaration. | |
bool | operator== (BitAccess const &a, BitAccess const &b) noexcept |
Comparison of two BitAccess instances for equality. | |
bool | operator!= (BitAccess const &a, BitAccess const &b) noexcept |
Comparison of two BitAccess instances for inequality. | |
Utility class used for the access operator of the BitVector
.
This utility class is created when the bit vector is accessed through the access operator. It cannot be created explicitly and cannot be assigned. It can only be cast to bool (for read access) or be assigned a bool (for write access).
|
inlinenoexcept |
Constructor setting 64-bit word and position of the bit in the word.
This constructor can be used when a single bit in the bit vector has to be accessed and one does not want to extract the bit from the 64-bit word manually.
data | Pointer to the 64-bit word that contains the bit. |
position | Position of the bit within the 64-bit word. |
|
inlinenoexcept |
Computes the distance to another BitAccess
instance.
This function is only used within the iterator and usually should not be required in any other situation. It has undefined behavior if used for two instances from different BitVector
.
other | The BitAccess instance the distance is computed to. |
this
and the other BitAccess
instance.
|
inlinenoexcept |
User-defined conversion function to bool.
Used for read access to a single bit.
|
inlinenoexcept |
Assignment operator to set a bit within the bit vector.
value | Value the bit should be written to. |
Comparison of two BitAccess
instances for inequality.
This does not compare the value the BitAccess
instance refers to but rather if the two instances refer to different position or to different BitVector
.
true
if both instances refer to different position or different BitVector
and false
otherwise.