MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::ValIter< T > Struct Template Reference

Iterator that gives copies of elements of a collection. More...

#include <iter.hpp>

Collaboration diagram for mtcore::ValIter< T >:

Public Types

using IterElem = std::remove_const_t<typename T::Elem>
 

Public Member Functions

Optional< IterElemnext ()
 

Public Attributes

const T & s
 
size_t index = 0
 

Detailed Description

template<Addressable T>
struct mtcore::ValIter< T >

Iterator that gives copies of elements of a collection.

Template Parameters
TCollection being iterated over

Definition at line 70 of file iter.hpp.

Member Typedef Documentation

◆ IterElem

template<Addressable T>
using mtcore::ValIter< T >::IterElem = std::remove_const_t<typename T::Elem>

Definition at line 71 of file iter.hpp.

Member Function Documentation

◆ next()

template<Addressable T>
Optional< IterElem > mtcore::ValIter< T >::next ( )
inline

Definition at line 75 of file iter.hpp.

75 {
76 if (index >= s.size()) {
77 return {};
78 }
79 return s[index++];
80 }
const T & s
Definition iter.hpp:72
size_t index
Definition iter.hpp:73

Member Data Documentation

◆ index

template<Addressable T>
size_t mtcore::ValIter< T >::index = 0

Definition at line 73 of file iter.hpp.

◆ s

template<Addressable T>
const T& mtcore::ValIter< T >::s

Definition at line 72 of file iter.hpp.


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