Skip to content

Constant Iterator

Kamil Krauze edited this page Jan 18, 2024 · 7 revisions

inline const_iterator() noexcept : m_ptr() {}

inline const_iterator(PointerType ptr) noexcept : m_ptr(ptr) { }

_NODISCARD inline ReferenceType operator[](const size_t index) const noexcept { return *(m_ptr[index]); }

_NODISCARD inline PointerType operator->() const noexcept { return m_ptr; }

_NODISCARD inline ReferenceType operator*() const noexcept { return *m_ptr; }


Arithmetic

inline const_iterator& operator++() noexcept

inline const_iterator operator++(int) noexcept

inline const_iterator& operator--() noexcept

inline const_iterator operator--(int) noexcept

inline const_iterator& operator+=(const size_t val) noexcept

_NODISCARD inline const_iterator operator+(const size_t val) const noexcept

inline const_iterator& operator-=(const size_t val) noexcept

_NODISCARD inline const_iterator operator-(const size_t val) const noexcept


Relational Operators

bool operator==(const const_iterator& other) const noexcept

bool operator!=(const const_iterator& other) const noexcept

bool operator>=(const const_iterator& other) const noexcept

bool operator<=(const const_iterator& other) const noexcept

bool operator>(const const_iterator& other) const noexcept

bool operator<(const const_iterator& other) const noexcept

Clone this wiki locally