Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::Bitset64< IndexType >::Iterator Class Reference

#include <bitset.h>

Public Types

using difference_type = std::ptrdiff_t
 
using iterator_category = std::forward_iterator_tag
 
using value_type = IndexType
 
using size_type = std::size_t
 
using reference = value_type&
 
using pointer = value_type*
 

Public Member Functions

 Iterator ()
 
 Iterator (Iterator &&other)=default
 
 Iterator (const Iterator &other)=default
 
Iteratoroperator= (const Iterator &other)=default
 
 Iterator (const Bitset64 &bitset)
 
bool operator== (const Iterator &other) const
 
bool operator!= (const Iterator &other) const
 
IndexType operator* () const
 
Iterator operator++ (int)
 
Iteratoroperator++ ()
 

Static Public Member Functions

static Iterator EndIterator (const Bitset64 &bitset)
 

Detailed Description

template<typename IndexType = int64_t>
class operations_research::Bitset64< IndexType >::Iterator

Class to iterate over the bit positions at 1 of a Bitset64.

IMPORTANT: Because the iterator "caches" the current uint64_t bucket, this will probably not do what you want if Bitset64 is modified while iterating.

Definition at line 620 of file bitset.h.

Member Typedef Documentation

◆ difference_type

template<typename IndexType = int64_t>
using operations_research::Bitset64< IndexType >::Iterator::difference_type = std::ptrdiff_t

Definition at line 628 of file bitset.h.

◆ iterator_category

template<typename IndexType = int64_t>
using operations_research::Bitset64< IndexType >::Iterator::iterator_category = std::forward_iterator_tag

Definition at line 629 of file bitset.h.

◆ pointer

template<typename IndexType = int64_t>
using operations_research::Bitset64< IndexType >::Iterator::pointer = value_type*

Definition at line 633 of file bitset.h.

◆ reference

template<typename IndexType = int64_t>
using operations_research::Bitset64< IndexType >::Iterator::reference = value_type&

Definition at line 632 of file bitset.h.

◆ size_type

template<typename IndexType = int64_t>
using operations_research::Bitset64< IndexType >::Iterator::size_type = std::size_t

Definition at line 631 of file bitset.h.

◆ value_type

template<typename IndexType = int64_t>
using operations_research::Bitset64< IndexType >::Iterator::value_type = IndexType

Definition at line 630 of file bitset.h.

Constructor & Destructor Documentation

◆ Iterator() [1/4]

template<typename IndexType = int64_t>
operations_research::Bitset64< IndexType >::Iterator::Iterator ( )
inline

Make this iterator a std::forward_iterator, so it works with std::sample, std::max_element, etc.

Definition at line 624 of file bitset.h.

◆ Iterator() [2/4]

template<typename IndexType = int64_t>
operations_research::Bitset64< IndexType >::Iterator::Iterator ( Iterator && other)
default

◆ Iterator() [3/4]

template<typename IndexType = int64_t>
operations_research::Bitset64< IndexType >::Iterator::Iterator ( const Iterator & other)
default

◆ Iterator() [4/4]

template<typename IndexType = int64_t>
operations_research::Bitset64< IndexType >::Iterator::Iterator ( const Bitset64 & bitset)
inlineexplicit

Definition at line 635 of file bitset.h.

Member Function Documentation

◆ EndIterator()

template<typename IndexType = int64_t>
static Iterator operations_research::Bitset64< IndexType >::Iterator::EndIterator ( const Bitset64 & bitset)
inlinestatic

Definition at line 643 of file bitset.h.

◆ operator!=()

template<typename IndexType = int64_t>
bool operations_research::Bitset64< IndexType >::Iterator::operator!= ( const Iterator & other) const
inline

Definition at line 648 of file bitset.h.

◆ operator*()

template<typename IndexType = int64_t>
IndexType operations_research::Bitset64< IndexType >::Iterator::operator* ( ) const
inline

Definition at line 656 of file bitset.h.

◆ operator++() [1/2]

template<typename IndexType = int64_t>
Iterator & operations_research::Bitset64< IndexType >::Iterator::operator++ ( )
inline

Computes the index and clear the least significant bit of current_.

Definition at line 664 of file bitset.h.

◆ operator++() [2/2]

template<typename IndexType = int64_t>
Iterator operations_research::Bitset64< IndexType >::Iterator::operator++ ( int )
inline

Definition at line 658 of file bitset.h.

◆ operator=()

template<typename IndexType = int64_t>
Iterator & operations_research::Bitset64< IndexType >::Iterator::operator= ( const Iterator & other)
default

◆ operator==()

template<typename IndexType = int64_t>
bool operations_research::Bitset64< IndexType >::Iterator::operator== ( const Iterator & other) const
inline

Definition at line 647 of file bitset.h.


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