Bitcoin Core 28.99.0
P2P Digital Currency
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
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. More...
 
constexpr Iterator (const Iterator &) noexcept=default
 
constexpr Iteratoroperator= (const Iterator &) noexcept=default
 
constexpr Iteratoroperator++ () noexcept
 Progress to the next 1 bit (only if != IteratorEnd). More...
 
constexpr unsigned operator* () const noexcept
 Get the current bit position (only if != IteratorEnd). More...
 

Private Member Functions

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

Private Attributes

m_val
 The original integer's remaining bits. More...
 
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). More...
 

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 >
constexpr bitset_detail::IntBitSet< I >::Iterator::Iterator ( val)
inlineconstexprprivatenoexcept

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

Definition at line 86 of file bitset.h.

◆ 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 >
constexpr bitset_detail::IntBitSet< I >::Iterator::Iterator ( const Iterator )
constexprdefaultnoexcept

Member Function Documentation

◆ operator*()

template<typename I >
constexpr 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 >
constexpr 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.

◆ operator=()

template<typename I >
constexpr Iterator & bitset_detail::IntBitSet< I >::Iterator::operator= ( const Iterator )
constexprdefaultnoexcept

Friends And Related Function Documentation

◆ IntBitSet

template<typename I >
friend class IntBitSet
friend

Definition at line 83 of file bitset.h.

◆ operator==

template<typename I >
constexpr 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: