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

Iterator that gives pointers to elements of a collection. More...

#include <iter.hpp>

Collaboration diagram for mtcore::PtrIter< T >:

Public Types

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

Public Member Functions

Optional< IterElemnext ()
 

Public Attributes

T & s
 
size_t index = 0
 

Detailed Description

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

Iterator that gives pointers to elements of a collection.

Template Parameters
TCollection being iterated over

Definition at line 32 of file iter.hpp.

Member Typedef Documentation

◆ IterElem

template<Addressable T>
using mtcore::PtrIter< T >::IterElem = std::add_pointer_t<typename T::Elem>

Definition at line 33 of file iter.hpp.

Member Function Documentation

◆ next()

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

Definition at line 37 of file iter.hpp.

37 {
38 if (index >= s.size()) {
39 return {};
40 }
41 return &s[index++];
42 }
size_t index
Definition iter.hpp:35

Member Data Documentation

◆ index

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

Definition at line 35 of file iter.hpp.

◆ s

template<Addressable T>
T& mtcore::PtrIter< T >::s

Definition at line 34 of file iter.hpp.


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