pasta::bit_vector  v1.0.0
Compact and Fast Rank and Select Data Structure for Bit Vectors
pasta::BitVector::Iterator Struct Reference

Custom iterator for BitVector. More...

#include <bit_vector.hpp>

Public Types

using iterator_category = std::forward_iterator_tag
 Iterator category.
 
using differece_type = std::ptrdiff_t
 Difference type.
 
using value_type = BitAccess
 Value type is not bit but the BitAccess object used for access.
 
using pointer = value_type *
 Pointer type.
 
using reference = value_type &
 Reference type.
 

Public Member Functions

 Iterator (uint64_t *const data, size_t const position) noexcept
 Constructor. Creates Iterator pointing at a bit and holds pointer to data. More...
 
reference operator* () noexcept
 Iterator is dereferenceable. Obtain value it is pointing at. More...
 
pointer operator-> () noexcept
 Iterator is dereferenceable. Obtain value it is pointing at. More...
 
Iteratoroperator++ () noexcept
 Prefix increment.
 
Iterator operator++ (int32_t) noexcept
 Postfix increment.
 

Friends

bool operator== (Iterator const &a, Iterator const &b) noexcept
 Iterator comparison equality.
 
bool operator!= (Iterator const &a, Iterator const &b) noexcept
 Iterator comparison inequality.
 
differece_type operator- (Iterator const &a, Iterator const &b) noexcept
 Iterator distance computation.
 

Detailed Description

Custom iterator for BitVector.

Constructor & Destructor Documentation

◆ Iterator()

pasta::BitVector::Iterator::Iterator ( uint64_t *const  data,
size_t const  position 
)
inlinenoexcept

Constructor. Creates Iterator pointing at a bit and holds pointer to data.

Parameters
dataPointer to the beginning of the BitVector.
positionPosition the iterator is pointing at.

Member Function Documentation

◆ operator*()

reference pasta::BitVector::Iterator::operator* ( )
inlinenoexcept

Iterator is dereferenceable. Obtain value it is pointing at.

Returns
Reference to the bit the iterator points at.

◆ operator->()

pointer pasta::BitVector::Iterator::operator-> ( )
inlinenoexcept

Iterator is dereferenceable. Obtain value it is pointing at.

Returns
Pointer to the bit the iterator points at.

The documentation for this struct was generated from the following file: