cortexlib
v0.2.0
|
Normal Iterator. More...
#include <normal.hxx>
Public Types | |
using | iterator_type = Iterator |
using | iterator_category = typename iter_traits_type::iterator_category |
using | value_type = typename iter_traits_type::value_type |
using | difference_type = typename iter_traits_type::difference_type |
using | pointer = typename iter_traits_type::pointer |
using | reference = typename iter_traits_type::reference |
Public Member Functions | |
constexpr | normal_iterator () noexcept |
Default Constructor. More... | |
template<typename Iter > | |
requires constexpr std::convertible_to< Iter, Iterator > | normal_iterator (const normal_iterator< Iter, Container > &other) noexcept |
Converting Copy Constructor. More... | |
constexpr | normal_iterator (const iterator_type &other) noexcept |
Iterator Copy Constructor. More... | |
constexpr auto | operator* () noexcept -> reference |
Dereference Operator Overload. More... | |
constexpr auto | operator* () const noexcept -> reference |
Dereference Operator Overload. More... | |
constexpr auto | operator-> () noexcept -> pointer |
Arrow Deference Operator Overload. More... | |
constexpr auto | operator-> () const noexcept -> pointer |
Arrow Deference Operator Overload. More... | |
constexpr auto | operator++ () noexcept -> normal_iterator & |
Prefix Increment Operator Overload. More... | |
constexpr auto | operator++ (int) noexcept -> normal_iterator |
Postfix Increment Operator Overload. More... | |
constexpr auto | operator-- () noexcept -> normal_iterator & |
Prefix Decrement Operator Overload. More... | |
constexpr auto | operator-- (int) noexcept -> normal_iterator |
Postfix Decrement Operator Overload. More... | |
constexpr auto | operator[] (difference_type n) noexcept -> reference |
Subscript Operator Overload. More... | |
constexpr auto | operator+= (difference_type step) noexcept -> normal_iterator & |
Additive Assignment Operator Overload. More... | |
constexpr auto | operator-= (difference_type step) noexcept -> normal_iterator & |
Subtraction Assignment Operator Overload. More... | |
constexpr auto | operator+ (difference_type step) const noexcept -> normal_iterator |
Addition Operator Overload. More... | |
constexpr auto | operator- (difference_type step) const noexcept -> normal_iterator |
Subtraction Operator Overload. More... | |
constexpr auto | base () const noexcept -> iterator_type |
Base Member Access. More... | |
Protected Types | |
using | iter_traits_type = std::iterator_traits< Iterator > |
Protected Attributes | |
Iterator | current |
Normal Iterator.
This iterator is used to adapt non-iterator objects into objects (ie. pointers). normal_iterators does not change the semantics of the operators of the underlying iterator of type Iterator.
Iterator | The underlying type of the iterator. |
Container | Allows iterators to be of different type even if the Iterator type is the same. |
using cxl::normal_iterator< Iterator, Container >::difference_type = typename iter_traits_type::difference_type |
|
protected |
using cxl::normal_iterator< Iterator, Container >::iterator_category = typename iter_traits_type::iterator_category |
using cxl::normal_iterator< Iterator, Container >::iterator_type = Iterator |
using cxl::normal_iterator< Iterator, Container >::pointer = typename iter_traits_type::pointer |
using cxl::normal_iterator< Iterator, Container >::reference = typename iter_traits_type::reference |
using cxl::normal_iterator< Iterator, Container >::value_type = typename iter_traits_type::value_type |
|
inlineconstexprnoexcept |
Default Constructor.
Initialises current to the default value of the type Iterator.
|
inlineconstexprnoexcept |
Converting Copy Constructor.
Uses copy semantics to initialise current from another normal_iterator from a different underlying iterator type.
Iter |
other | type: const normal_iterator<Iter, Container>& |
|
inlineconstexprnoexcept |
Iterator Copy Constructor.
Uses copy semantics to initialise current from an object as the same type as iterator_type. Because the the underlying types must be the same, current can be directly initialised from other.
other | type: const iterator_type& |
|
inlineconstexprnoexcept |
Base Member Access.
Returns a raw copy of current.
|
inlineconstexprnoexcept |
Dereference Operator Overload.
Dereferences current and returns a reference of the value to the caller.
|
inlineconstexprnoexcept |
Dereference Operator Overload.
Dereferences current and returns a reference of the value to the caller.
|
inlineconstexprnoexcept |
Addition Operator Overload.
Constructs a new iterator from the addition of current and step.
step |
|
inlineconstexprnoexcept |
Prefix Increment Operator Overload.
Applies the prefix increment operator to current and returns a reference to this.
|
inlineconstexprnoexcept |
Postfix Increment Operator Overload.
Constructs a new iterator from current while applying the postfix increment operator on Construction. This effectively increments current for this while creating a new iterator with its current equal to the last value of this current.
|
inlineconstexprnoexcept |
Additive Assignment Operator Overload.
Increases the current's pointer value by step and assigns current the new pointer value and returns a reference to this.
step |
|
inlineconstexprnoexcept |
Subtraction Operator Overload.
Constructs a new iterator from the subtraction of current and step.
step |
|
inlineconstexprnoexcept |
Prefix Decrement Operator Overload.
Applies the prefix decrement operator to current and returns a reference to this.
|
inlineconstexprnoexcept |
Postfix Decrement Operator Overload.
Constructs a new iterator from current while applying the postfix decrement operator on construction. This effectively decrements current for this while creating a new iterator with its current equal to the last value of this current.
|
inlineconstexprnoexcept |
Subtraction Assignment Operator Overload.
Decreases the current's pointer value by step and assigns current the new pointer value and returns a reference to this.
step |
|
inlineconstexprnoexcept |
Arrow Deference Operator Overload.
Returns a pointer of current, this allows for access to the internal members if current is a class or object type through "indirection chaining".
|
inlineconstexprnoexcept |
Arrow Deference Operator Overload.
Returns a pointer of current, this allows for access to the internal members if current is a class or object type through "indirection chaining".
|
inlineconstexprnoexcept |
Subscript Operator Overload.
Accesses the element at an offset to current's location in memory and returns a reference to the value stored at that location.
n | type: difference_type |
|
protected |