Clingo
Loading...
Searching...
No Matches
CppClingo::Util::enumerate< T >::iterator Class Reference

Iterator yielding a index and a reference. More...

#include <enumerate.hh>

Public Types

using iterator_category = std::forward_iterator_tag
 The iterator category.
 
using value_type = std::pair< size_t, typename T::reference >
 The index and the reference the iterator is referring to.
 
using difference_type = std::make_signed_t< size_t >
 The difference type.
 
using iterator_category = std::forward_iterator_tag
 The iterator category.
 
using value_type = T
 The value type.
 
using difference_type = std::make_signed_t< value_type >
 The difference type.
 

Public Member Functions

 iterator ()=default
 Construct an invalid iterator.
 
 iterator (size_t num, T cur)
 Construct an iterator from an index and a forward iterator.
 
auto operator* () const -> value_type
 Get the reference.
 
auto operator++ () -> iterator &
 Advance the iterator.
 
auto operator++ (int) -> iterator
 Advance the iterator.
 
 iterator ()=default
 Construct an invalid iterator.
 
 iterator (value_type cur)
 Construct an iterator from an integer.
 
auto operator* () const -> value_type
 Get the current integer.
 
auto operator++ () -> iterator &
 Advance the iterator.
 
auto operator++ (int) -> iterator
 Advance the iterator.
 

Friends

auto operator== (iterator const &a, iterator const &b) -> bool
 Compare two iterators.
 
auto operator== (iterator const &a, iterator const &b) -> bool=default
 Compare two iterators.
 

Detailed Description

template<std::forward_iterator T>
class CppClingo::Util::enumerate< T >::iterator

Iterator yielding a index and a reference.


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