11 using iterator_category = std::random_access_iterator_tag;
13 using difference_type = std::ptrdiff_t;
14 using pointer =
const T*;
15 using reference =
const T&;
24 m_pArray =
const_cast<ARRAY*
>(&deque);
50 PL_ALWAYS_INLINE
bool operator==(
const const_iterator_base& rhs)
const {
return m_pArray == rhs.m_pArray && m_uiIndex == rhs.m_uiIndex; }
51 PL_ALWAYS_INLINE
bool operator!=(
const const_iterator_base& rhs)
const {
return !(*
this == rhs); }
53 PL_ALWAYS_INLINE std::ptrdiff_t operator-(
const const_iterator_base& rhs)
const {
return m_uiIndex - rhs.m_uiIndex; }
58 PL_ALWAYS_INLINE
void operator+=(std::ptrdiff_t rhs) { m_uiIndex += rhs; }
59 PL_ALWAYS_INLINE
void operator-=(std::ptrdiff_t rhs) { m_uiIndex -= rhs; }
61 inline const T& operator*()
const
64 return (*m_pArray)[m_pArray->GetCount() - (plUInt32)m_uiIndex - 1];
66 return (*m_pArray)[(plUInt32)m_uiIndex];
68 PL_ALWAYS_INLINE
const T* operator->()
const {
return &(**this); }
70 PL_ALWAYS_INLINE
bool operator<(
const const_iterator_base& rhs)
const {
return m_uiIndex < rhs.m_uiIndex; }
71 PL_ALWAYS_INLINE
bool operator>(
const const_iterator_base& rhs)
const {
return m_uiIndex > rhs.m_uiIndex; }
72 PL_ALWAYS_INLINE
bool operator<=(
const const_iterator_base& rhs)
const {
return m_uiIndex <= rhs.m_uiIndex; }
73 PL_ALWAYS_INLINE
bool operator>=(
const const_iterator_base& rhs)
const {
return m_uiIndex >= rhs.m_uiIndex; }
75 PL_ALWAYS_INLINE
const T& operator[](
size_t uiIndex)
const
78 return (*m_pArray)[m_pArray->GetCount() -
static_cast<plUInt32
>(m_uiIndex + uiIndex) - 1];
80 return (*m_pArray)[
static_cast<plUInt32
>(m_uiIndex + uiIndex)];
104 this->m_uiIndex += 1;
109 this->m_uiIndex -= 1;
115 this->m_uiIndex += 1;
120 this->m_uiIndex -= 1;
127 PL_ALWAYS_INLINE
iterator_base operator+(std::ptrdiff_t rhs)
const {
return iterator_base(*this->m_pArray, this->m_uiIndex + rhs); }
128 PL_ALWAYS_INLINE
iterator_base operator-(std::ptrdiff_t rhs)
const {
return iterator_base(*this->m_pArray, this->m_uiIndex - rhs); }
130 inline T& operator*()
const
133 return (*this->m_pArray)[this->m_pArray->GetCount() - (plUInt32)this->m_uiIndex - 1];
135 return (*this->m_pArray)[(plUInt32)this->m_uiIndex];
138 PL_ALWAYS_INLINE T* operator->()
const {
return &(**this); }
140 PL_ALWAYS_INLINE T& operator[](
size_t uiIndex)
const
143 return (*this->m_pArray)[this->m_pArray->GetCount() -
static_cast<plUInt32
>(this->m_uiIndex + uiIndex) - 1];
145 return (*this->m_pArray)[
static_cast<plUInt32
>(this->m_uiIndex + uiIndex)];
154 using iterator_category = std::random_access_iterator_tag;
155 using value_type = T;
156 using difference_type = std::ptrdiff_t;
158 using reference = T&;
162 : m_pPtr(
const_cast<T*
>(pPtr))
196 PL_ALWAYS_INLINE
void operator+=(std::ptrdiff_t rhs) { m_pPtr -= rhs; }
197 PL_ALWAYS_INLINE
void operator-=(std::ptrdiff_t rhs) { m_pPtr += rhs; }
199 PL_ALWAYS_INLINE
const T& operator*()
const {
return *m_pPtr; }
200 PL_ALWAYS_INLINE
const T* operator->()
const {
return m_pPtr; }
207 PL_ALWAYS_INLINE
const T& operator[](std::ptrdiff_t index)
const {
return *(m_pPtr - index); }