https://mooseframework.inl.gov
Public Types | Public Member Functions | Private Attributes | List of all members
Moose::_enumerate_iterator< Iterator > Struct Template Reference

#include <Enumerate.h>

Public Types

using iterator = Iterator
 
using index_type = typename std::iterator_traits< iterator >::difference_type
 
using reference = typename std::iterator_traits< iterator >::reference
 

Public Member Functions

 _enumerate_iterator (index_type index, iterator iterator)
 
_enumerate_iteratoroperator++ ()
 
bool operator!= (const _enumerate_iterator &other) const
 
_enumerate_struct< iteratoroperator* ()
 When MOOSE moves to C++17, we'll switch the return type of the dereference operator and the corresponding calling code. More...
 

Private Attributes

index_type index
 
iterator iter
 

Detailed Description

template<class Iterator>
struct Moose::_enumerate_iterator< Iterator >

Definition at line 22 of file Enumerate.h.

Member Typedef Documentation

◆ index_type

template<class Iterator >
using Moose::_enumerate_iterator< Iterator >::index_type = typename std::iterator_traits<iterator>::difference_type

Definition at line 99 of file Enumerate.h.

◆ iterator

template<class Iterator >
using Moose::_enumerate_iterator< Iterator >::iterator = Iterator

Definition at line 98 of file Enumerate.h.

◆ reference

template<class Iterator >
using Moose::_enumerate_iterator< Iterator >::reference = typename std::iterator_traits<iterator>::reference

Definition at line 100 of file Enumerate.h.

Constructor & Destructor Documentation

◆ _enumerate_iterator()

template<class Iterator >
Moose::_enumerate_iterator< Iterator >::_enumerate_iterator ( index_type  index,
iterator  iterator 
)
inline

Definition at line 102 of file Enumerate.h.

Member Function Documentation

◆ operator!=()

template<class Iterator >
bool Moose::_enumerate_iterator< Iterator >::operator!= ( const _enumerate_iterator< Iterator > &  other) const
inline

Definition at line 111 of file Enumerate.h.

111 { return iter != other.iter; }

◆ operator*()

template<class Iterator >
_enumerate_struct<iterator> Moose::_enumerate_iterator< Iterator >::operator* ( )
inline

When MOOSE moves to C++17, we'll switch the return type of the dereference operator and the corresponding calling code.

This is what we'll use instead.

if __cplusplus > 201402L std::pair<index_type &, reference> operator*() { return {index, *iter}; } #endif

Definition at line 122 of file Enumerate.h.

122 { return _enumerate_struct<iterator>(index, iter); }

◆ operator++()

template<class Iterator >
_enumerate_iterator& Moose::_enumerate_iterator< Iterator >::operator++ ( )
inline

Definition at line 104 of file Enumerate.h.

105  {
106  ++index;
107  ++iter;
108  return *this;
109  }

Member Data Documentation

◆ index

template<class Iterator >
index_type Moose::_enumerate_iterator< Iterator >::index
private

◆ iter

template<class Iterator >
iterator Moose::_enumerate_iterator< Iterator >::iter
private

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