32 throw std::runtime_error(
"Dereferencing past-the-end iterator!");
39 throw std::runtime_error(
"Dereferencing past-the-end iterator!");
71 std::size_t end =
m_N;
76 if (++(*backItr) < end)
82 std::iota(backItr.base(),
m_current.end(), *backItr + 1);
111 return !(*
this == other);
bool exhausted() const
True if this iterator is past the end.
bool operator==(const KFromNItr &other) const
Iterator comparison functions.
bool operator!=(const KFromNItr &other) const
pointer operator->() const
const value_type & reference
reference operator*() const
Dereference.
KFromNItr()=default
Default constructor creates a generic past-the-end iterator.
KFromNItr & operator++()
Pre-increment operator.
std::size_t size() const
The size of each combination (k)
void reset()
Reset the iterator to its start position.
std::vector< std::size_t > m_current
The current combination.
std::size_t m_N
The number of indices.
const value_type * pointer