Skip to main content

The Iterator Class Template Reference

bidirectional iterator More...

Declaration

template <class C, class I> class GrowVector::Iterator<C, I> { ... }

Included Headers

#include <src/growvector.h>

Public Member Typedefs Index

template <class C, class I>
usingiterator_category = std::bidirectional_iterator_tag
template <class C, class I>
usingdifference_type = std::ptrdiff_t
template <class C, class I>
usingvalue_type = I
template <class C, class I>
usingpointer = I *
template <class C, class I>
usingreference = I &

Friends Index

template <class C, class I>
booloperator==
template <class C, class I>
booloperator!=

Public Constructors Index

template <class C, class I>
Iterator (C &vec, size_t pos)

Public Operators Index

template <class C, class I>
referenceoperator* () const
template <class C, class I>
pointeroperator-> ()
template <class C, class I>
Iterator &operator++ ()
template <class C, class I>
Iteratoroperator++ (int)
template <class C, class I>
Iterator &operator-- ()
template <class C, class I>
Iteratoroperator-- (int)

Private Member Attributes Index

template <class C, class I>
C *m_vec
template <class C, class I>
size_tm_pos

Description

bidirectional iterator

Definition at line 55 of file growvector.h.

Public Member Typedefs

difference_type

template <class C, class I>
using GrowVector< T >::Iterator< C, I >::difference_type = std::ptrdiff_t

Definition at line 59 of file growvector.h.

59 using difference_type = std::ptrdiff_t;

iterator_category

template <class C, class I>
using GrowVector< T >::Iterator< C, I >::iterator_category = std::bidirectional_iterator_tag

Definition at line 58 of file growvector.h.

58 using iterator_category = std::bidirectional_iterator_tag;

pointer

template <class C, class I>
using GrowVector< T >::Iterator< C, I >::pointer = I*

Definition at line 61 of file growvector.h.

61 using pointer = I*;

reference

template <class C, class I>
using GrowVector< T >::Iterator< C, I >::reference = I&

Definition at line 62 of file growvector.h.

62 using reference = I&;

value_type

template <class C, class I>
using GrowVector< T >::Iterator< C, I >::value_type = I

Definition at line 60 of file growvector.h.

60 using value_type = I;

Friends

operator!=

friend bool const Iterator & a, const Iterator & b
inline

Definition at line 73 of file growvector.h.

73 friend bool operator!=(const Iterator& a, const Iterator& b) { return a.m_pos != b.m_pos; };

operator==

friend bool const Iterator & a, const Iterator & b
inline

Definition at line 72 of file growvector.h.

72 friend bool operator==(const Iterator& a, const Iterator& b) { return a.m_pos == b.m_pos; };

Public Constructors

Iterator()

template <class C, class I>
GrowVector< T >::Iterator< C, I >::Iterator (C & vec, size_t pos)
inline

Definition at line 64 of file growvector.h.

64 Iterator(C &vec,size_t pos) : m_vec(&vec), m_pos(pos) {}

Public Operators

operator--()

template <class C, class I>
Iterator & GrowVector< T >::Iterator< C, I >::operator-- ()
inline

Definition at line 70 of file growvector.h.

70 Iterator& operator--() { m_pos--; return *this; }

operator--()

template <class C, class I>
Iterator GrowVector< T >::Iterator< C, I >::operator-- (int)
inline

Definition at line 71 of file growvector.h.

71 Iterator operator--(int) { Iterator tmp = *this; --(*this); return tmp; }

operator->()

template <class C, class I>
pointer GrowVector< T >::Iterator< C, I >::operator-> ()
inline

Definition at line 67 of file growvector.h.

67 pointer operator->() { return &m_vec->at(m_pos); }

operator*()

template <class C, class I>
reference GrowVector< T >::Iterator< C, I >::operator* ()
inline

Definition at line 66 of file growvector.h.

66 reference operator*() const { return m_vec->at(m_pos); }

operator++()

template <class C, class I>
Iterator & GrowVector< T >::Iterator< C, I >::operator++ ()
inline

Definition at line 68 of file growvector.h.

68 Iterator& operator++() { m_pos++; return *this; }

operator++()

template <class C, class I>
Iterator GrowVector< T >::Iterator< C, I >::operator++ (int)
inline

Definition at line 69 of file growvector.h.

69 Iterator operator++(int) { Iterator tmp = *this; ++(*this); return tmp; }

Private Member Attributes

m_pos

template <class C, class I>
size_t GrowVector< T >::Iterator< C, I >::m_pos

m_vec

template <class C, class I>
C* GrowVector< T >::Iterator< C, I >::m_vec

Definition at line 76 of file growvector.h.

76 C *m_vec;

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


Generated via doxygen2docusaurus by Doxygen 1.14.0.