MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::iter Namespace Reference

Generic iterator defaults built on common contracts Does not guarantee performance of iterators Actual performance is \(O(N * complexityOfOperator[])\) IE an operator[] with \(O(1)\) will get an iterator complexity of \(O(N)\), while an operator[] with \(O(N)\) will get an iterator complexity of \(O(N^2)\). More...

Functions

template<typename T>
PtrIter< T > ptr (T &r)
 Generic pointer iterator that uses the operator[] and incrementing indexes to iterate over a collection Returns pointers to elements inside the collection (can be modified)
 
template<typename T>
ValIter< T > val (const T &r)
 Generic value iterator that uses the operator[] and incrementing indexes to iterate over a collection Does copies when iterating`.
 
template<typename T>
ConstPtrIter< T > const_ptr (const T &r)
 Generic constant pointer iterator that uses the operator[] and incrementing indexes to iterate over a collection Returns constant pointers to elements inside the collection (cannot be modified) Useful for reads while avoiding copies.
 

Detailed Description

Generic iterator defaults built on common contracts Does not guarantee performance of iterators Actual performance is \(O(N * complexityOfOperator[])\) IE an operator[] with \(O(1)\) will get an iterator complexity of \(O(N)\), while an operator[] with \(O(N)\) will get an iterator complexity of \(O(N^2)\).