Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
bitset_detail::IntBitSet< I >::Iterator Class Reference

Iterator type returned by begin(), which efficiently iterates all 1 positions. More...

Public Member Functions

 Iterator ()=delete
 Do not allow external code to construct an Iterator.
constexpr Iterator (const Iterator &) noexcept=default
constexpr Iteratoroperator= (const Iterator &) noexcept=default
constexpr Iteratoroperator++ () noexcept
 Progress to the next 1 bit (only if != IteratorEnd).
constexpr unsigned operator* () const noexcept
 Get the current bit position (only if != IteratorEnd).

Private Member Functions

constexpr Iterator (I val) noexcept
 Last reported 1 position (if m_pos != 0).

Private Attributes

m_val
 The original integer's remaining bits.
unsigned m_pos

Friends

class IntBitSet
constexpr friend bool operator== (const Iterator &a, const IteratorEnd &) noexcept
 Test whether we are done (can only compare with IteratorEnd).

Detailed Description

template<typename I>
class bitset_detail::IntBitSet< I >::Iterator

Iterator type returned by begin(), which efficiently iterates all 1 positions.

Definition at line 81 of file bitset.h.

Constructor & Destructor Documentation

◆ Iterator() [1/3]

template<typename I>
bitset_detail::IntBitSet< I >::Iterator::Iterator ( I val)
inlineconstexprprivatenoexcept

Last reported 1 position (if m_pos != 0).

Definition at line 86 of file bitset.h.

Here is the caller graph for this function:

◆ Iterator() [2/3]

template<typename I>
bitset_detail::IntBitSet< I >::Iterator::Iterator ( )
delete

Do not allow external code to construct an Iterator.

◆ Iterator() [3/3]

template<typename I>
bitset_detail::IntBitSet< I >::Iterator::Iterator ( const Iterator & )
constexprdefaultnoexcept
Here is the call graph for this function:

Member Function Documentation

◆ operator*()

template<typename I>
unsigned bitset_detail::IntBitSet< I >::Iterator::operator* ( ) const
inlineconstexprnoexcept

Get the current bit position (only if != IteratorEnd).

Definition at line 110 of file bitset.h.

◆ operator++()

template<typename I>
Iterator & bitset_detail::IntBitSet< I >::Iterator::operator++ ( )
inlineconstexprnoexcept

Progress to the next 1 bit (only if != IteratorEnd).

Definition at line 102 of file bitset.h.

Here is the call graph for this function:

◆ operator=()

template<typename I>
Iterator & bitset_detail::IntBitSet< I >::Iterator::operator= ( const Iterator & )
constexprdefaultnoexcept
Here is the call graph for this function:

◆ IntBitSet

template<typename I>
friend class IntBitSet
friend

Definition at line 83 of file bitset.h.

◆ operator==

template<typename I>
friend bool operator== ( const Iterator & a,
const IteratorEnd &  )
friend

Test whether we are done (can only compare with IteratorEnd).

Definition at line 97 of file bitset.h.

Member Data Documentation

◆ m_pos

template<typename I>
unsigned bitset_detail::IntBitSet< I >::Iterator::m_pos
private

Definition at line 85 of file bitset.h.

◆ m_val

template<typename I>
I bitset_detail::IntBitSet< I >::Iterator::m_val
private

The original integer's remaining bits.

Definition at line 84 of file bitset.h.


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