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

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

#include <iter.hpp>

Collaboration diagram for mtcore::ConstPtrIter< T >:

Public Types

using IterElem = std::add_pointer_t<std::add_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::ConstPtrIter< T >

Iterator that gives const pointers to elements of a collection.

Template Parameters
TCollection being iterated over

Definition at line 51 of file iter.hpp.

Member Typedef Documentation

◆ IterElem

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

Definition at line 52 of file iter.hpp.

Member Function Documentation

◆ next()

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

Definition at line 56 of file iter.hpp.

56 {
57 if (index >= s.size()) {
58 return {};
59 }
60 return &s[index++];
61 }

Member Data Documentation

◆ index

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

Definition at line 54 of file iter.hpp.

◆ s

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

Definition at line 53 of file iter.hpp.


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