ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
ADS::Arena< T, A >::Iterator< Const > Class Template Reference

the iterator, on constant objects if Const More...

#include <ADS/memory/Arena.h>

Public types

using iterator_category = std::random_access_iterator_tag
 random access
using value_type = T
 the objects
using difference_type = std::ptrdiff_t
 a distance in objects
using reference = std::conditional_t< Const , const T & , T & >
 a reference to an object, constant if Const
using pointer = std::conditional_t< Const , const T * , T * >
 a pointer to an object, constant if Const

Public member functions

 Iterator (void)=default
 an iterator of no arena
 Iterator (Blocks B, std::size_t n, std::size_t i)
 the object \( i \) of the vector of the blocks \( B \), of \( n \) objects each
template<bool K>
requires ( Const && ! K )
 Iterator (const Iterator< K > &o)
 the constant iterator of the object of \( o \)
reference operator* (void) const
 the object
pointer operator-> (void) const
 the address of the object
reference operator[] (difference_type k) const
 the object \( k \) places ahead: the index \( j \) is at the place \( j \bmod n \) of the block \( \lfloor j / n \rfloor \)
Iterator & operator++ (void)
 the next object
Iterator & operator-- (void)
 the previous object
Iterator operator++ (int)
 the next object, the iterator before the step returned
Iterator operator-- (int)
 the previous object, the iterator before the step returned
Iterator & operator+= (difference_type k)
 \( k \) objects ahead
Iterator & operator-= (difference_type k)
 \( k \) objects back
bool operator== (const Iterator &o) const
 whether the two are at the same object
auto operator<=> (const Iterator &o) const
 the order of the objects

Friends

template<bool>
class Iterator
Iterator operator+ (Iterator a, difference_type k)
 the iterator \( k \) objects after \( a \)
Iterator operator+ (difference_type k, Iterator a)
 the iterator \( k \) objects after \( a \)
Iterator operator- (Iterator a, difference_type k)
 the iterator \( k \) objects before \( a \)
difference_type operator- (const Iterator &a, const Iterator &b)
 the number of objects from \( b \) to \( a \)

Detailed description

template<class T, class A = std::allocator< T >>
template<bool Const>
class ADS::Arena< T, A >::Iterator< Const >

the iterator, on constant objects if Const

Member typedef documentation

◆ difference_type

template<class T, class A = std::allocator< T >>
template<bool Const>
using ADS::Arena< T, A >::Iterator< Const >::difference_type = std::ptrdiff_t

a distance in objects

◆ iterator_category

template<class T, class A = std::allocator< T >>
template<bool Const>
using ADS::Arena< T, A >::Iterator< Const >::iterator_category = std::random_access_iterator_tag

random access

◆ pointer

template<class T, class A = std::allocator< T >>
template<bool Const>
using ADS::Arena< T, A >::Iterator< Const >::pointer = std::conditional_t< Const , const T * , T * >

a pointer to an object, constant if Const

◆ reference

template<class T, class A = std::allocator< T >>
template<bool Const>
using ADS::Arena< T, A >::Iterator< Const >::reference = std::conditional_t< Const , const T & , T & >

a reference to an object, constant if Const

◆ value_type

template<class T, class A = std::allocator< T >>
template<bool Const>
using ADS::Arena< T, A >::Iterator< Const >::value_type = T

the objects

Constructor and destructor documentation

◆ Iterator() [1/3]

template<class T, class A = std::allocator< T >>
template<bool Const>
ADS::Arena< T, A >::Iterator< Const >::Iterator ( void )
default

an iterator of no arena

◆ Iterator() [2/3]

template<class T, class A = std::allocator< T >>
template<bool Const>
ADS::Arena< T, A >::Iterator< Const >::Iterator ( Blocks B,
std::size_t n,
std::size_t i )
inline

the object \( i \) of the vector of the blocks \( B \), of \( n \) objects each

◆ Iterator() [3/3]

template<class T, class A = std::allocator< T >>
template<bool Const>
template<bool K>
requires ( Const && ! K )
ADS::Arena< T, A >::Iterator< Const >::Iterator ( const Iterator< K > & o)
inline

the constant iterator of the object of \( o \)

Member function documentation

◆ operator*()

template<class T, class A = std::allocator< T >>
template<bool Const>
reference ADS::Arena< T, A >::Iterator< Const >::operator* ( void ) const
inline

the object

◆ operator++() [1/2]

template<class T, class A = std::allocator< T >>
template<bool Const>
Iterator ADS::Arena< T, A >::Iterator< Const >::operator++ ( int )
inline

the next object, the iterator before the step returned

◆ operator++() [2/2]

template<class T, class A = std::allocator< T >>
template<bool Const>
Iterator & ADS::Arena< T, A >::Iterator< Const >::operator++ ( void )
inline

the next object

◆ operator+=()

template<class T, class A = std::allocator< T >>
template<bool Const>
Iterator & ADS::Arena< T, A >::Iterator< Const >::operator+= ( difference_type k)
inline

\( k \) objects ahead

◆ operator--() [1/2]

template<class T, class A = std::allocator< T >>
template<bool Const>
Iterator ADS::Arena< T, A >::Iterator< Const >::operator-- ( int )
inline

the previous object, the iterator before the step returned

◆ operator--() [2/2]

template<class T, class A = std::allocator< T >>
template<bool Const>
Iterator & ADS::Arena< T, A >::Iterator< Const >::operator-- ( void )
inline

the previous object

◆ operator-=()

template<class T, class A = std::allocator< T >>
template<bool Const>
Iterator & ADS::Arena< T, A >::Iterator< Const >::operator-= ( difference_type k)
inline

\( k \) objects back

◆ operator->()

template<class T, class A = std::allocator< T >>
template<bool Const>
pointer ADS::Arena< T, A >::Iterator< Const >::operator-> ( void ) const
inline

the address of the object

◆ operator<=>()

template<class T, class A = std::allocator< T >>
template<bool Const>
auto ADS::Arena< T, A >::Iterator< Const >::operator<=> ( const Iterator< Const > & o) const
inline

the order of the objects

◆ operator==()

template<class T, class A = std::allocator< T >>
template<bool Const>
bool ADS::Arena< T, A >::Iterator< Const >::operator== ( const Iterator< Const > & o) const
inline

whether the two are at the same object

◆ operator[]()

template<class T, class A = std::allocator< T >>
template<bool Const>
reference ADS::Arena< T, A >::Iterator< Const >::operator[] ( difference_type k) const
inline

the object \( k \) places ahead: the index \( j \) is at the place \( j \bmod n \) of the block \( \lfloor j / n \rfloor \)

◆ Iterator

template<class T, class A = std::allocator< T >>
template<bool Const>
template<bool>
friend class Iterator
friend

◆ operator+ [1/2]

template<class T, class A = std::allocator< T >>
template<bool Const>
Iterator operator+ ( difference_type k,
Iterator< Const > a )
friend

the iterator \( k \) objects after \( a \)

◆ operator+ [2/2]

template<class T, class A = std::allocator< T >>
template<bool Const>
Iterator operator+ ( Iterator< Const > a,
difference_type k )
friend

the iterator \( k \) objects after \( a \)

◆ operator- [1/2]

template<class T, class A = std::allocator< T >>
template<bool Const>
difference_type operator- ( const Iterator< Const > & a,
const Iterator< Const > & b )
friend

the number of objects from \( b \) to \( a \)

◆ operator- [2/2]

template<class T, class A = std::allocator< T >>
template<bool Const>
Iterator operator- ( Iterator< Const > a,
difference_type k )
friend

the iterator \( k \) objects before \( a \)


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