ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement > Struct Template Reference

Description:

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
struct alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >

Implementation of std::iterator_traits for this container.

As the name of the class indicates, this iterator satisfies the C++ standard library concept BidirectionalIterator .

Template Parameters
TConstOrMutableElementThe custom data type as either const or mutable.

Definition at line 114 of file list.inl.

Collaboration diagram for alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >:
[legend]

Public Type Index:

using difference_type = integer
 Implementation of std::iterator_traits.
 
using iterator_category = std::bidirectional_iterator_tag
 Implementation of std::iterator_traits.
 
using pointer = TConstOrMutableElement*
 Implementation of std::iterator_traits.
 
using reference = TConstOrMutableElement&
 Implementation of std::iterator_traits.
 
using value_type = TConstOrMutableElement
 Implementation of std::iterator_traits.
 

Public Method Index:

 TIterator ()=default
 Default constructor creating an invalid iterator.
 
template<typename TMutable>
requires std::same_as<TMutable, TIterator<typename std::remove_const<TConstOrMutableElement>::type>>
 TIterator (const TMutable &mutableIt)
 
 TIterator (Element *start)
 
bool operator!= (TIterator other) const
 
TConstOrMutableElement & operator* () const
 
TIteratoroperator++ ()
 
TIterator operator++ (int)
 
TIteratoroperator-- ()
 
TIterator operator-- (int)
 
TConstOrMutableElement * operator-> () const
 
bool operator== (TIterator other) const
 

Protected Field Index:

Elementelement
 The actual element of the list.
 

Type Definition Details:

◆ difference_type

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
using alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::difference_type = integer

Implementation of std::iterator_traits.

Definition at line 118 of file list.inl.

◆ iterator_category

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
using alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::iterator_category = std::bidirectional_iterator_tag

Implementation of std::iterator_traits.

Definition at line 116 of file list.inl.

◆ pointer

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
using alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::pointer = TConstOrMutableElement*

Implementation of std::iterator_traits.

Definition at line 119 of file list.inl.

◆ reference

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
using alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::reference = TConstOrMutableElement&

Implementation of std::iterator_traits.

Definition at line 120 of file list.inl.

◆ value_type

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
using alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::value_type = TConstOrMutableElement

Implementation of std::iterator_traits.

Definition at line 117 of file list.inl.

Field Details:

◆ element

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
Element* alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::element
protected

The actual element of the list.

Definition at line 123 of file list.inl.

Constructor(s) / Destructor Details:

◆ TIterator() [1/2]

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::TIterator ( Element * start)
inlineexplicit

Constructor.

Parameters
startPointer to the initial element.

Definition at line 136 of file list.inl.

◆ TIterator() [2/2]

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
template<typename TMutable>
requires std::same_as<TMutable, TIterator<typename std::remove_const<TConstOrMutableElement>::type>>
alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::TIterator ( const TMutable & mutableIt)
inline

Copy constructor accepting a mutable iterator. Available only for the constant version of this iterator.

Template Parameters
TMutableThe type of this constructor's argument.
Parameters
mutableItMutable iterator to copy from.

Definition at line 147 of file list.inl.

Method Details:

◆ operator!=()

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
bool alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::operator!= ( TIterator< TConstOrMutableElement > other) const
inline

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and given iterator are not equal, false otherwise.

Definition at line 180 of file list.inl.

◆ operator*()

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
TConstOrMutableElement & alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::operator* ( ) const
inline

Retrieves a reference to the referred element.

Returns
A reference to the referred element.

Definition at line 208 of file list.inl.

◆ operator++() [1/2]

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
TIterator & alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::operator++ ( )
inline

Prefix increment operator.

Returns
A reference to this object.

Definition at line 153 of file list.inl.

◆ operator++() [2/2]

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
TIterator alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::operator++ ( int )
inline

Postfix increment operator.

Returns
An iterator value that is not increased, yet.

Definition at line 161 of file list.inl.

◆ operator--() [1/2]

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
TIterator & alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::operator-- ( )
inline

Prefix decrement operator.

Returns
A reference to this object.

Definition at line 189 of file list.inl.

◆ operator--() [2/2]

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
TIterator alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::operator-- ( int )
inline

Postfix decrement operator.

Returns
The iterator value prior the decrement operation.

Definition at line 197 of file list.inl.

◆ operator->()

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
TConstOrMutableElement * alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::operator-> ( ) const
inline

Retrieves a pointer to the referred element.

Returns
A pointer to the referred element.

Definition at line 212 of file list.inl.

◆ operator==()

template<typename TAllocator, typename T, Recycling TRecycling = Recycling::Private>
template<typename TConstOrMutableElement>
bool alib::containers::List< TAllocator, T, TRecycling >::TIterator< TConstOrMutableElement >::operator== ( TIterator< TConstOrMutableElement > other) const
inline

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and the given iterator are pointing to the same element, false otherwise.

Definition at line 172 of file list.inl.


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