72 requires std::is_same_v<U, std::remove_cv_t<T>>
92 assert(ptr_ !=
nullptr);
192 return a.ptr_ - b.ptr_;
202 return a.ptr_ == b.ptr_;
212 return a.ptr_ <=> b.ptr_;
A raw-pointer-backed contiguous random-access iterator.
Definition Iterator.h:40
constexpr Iterator(const Iterator< U > &other) noexcept
Converting constructor from a non-const iterator to a const iterator.
Definition Iterator.h:73
T & reference
Definition Iterator.h:49
std::ptrdiff_t difference_type
Definition Iterator.h:47
T element_type
Definition Iterator.h:46
constexpr Iterator operator++(int) noexcept
Post-increments the iterator to point to the next element.
Definition Iterator.h:112
constexpr reference operator*() const noexcept
Dereferences the iterator.
Definition Iterator.h:77
std::contiguous_iterator_tag iterator_concept
Definition Iterator.h:43
friend constexpr bool operator==(const Iterator &a, const Iterator &b) noexcept
Compares two iterators for equality.
Definition Iterator.h:201
std::random_access_iterator_tag iterator_category
Definition Iterator.h:44
friend constexpr Iterator operator-(Iterator i, difference_type n) noexcept
Returns an iterator moved back by n positions.
Definition Iterator.h:180
constexpr Iterator & operator++() noexcept
Pre-increments the iterator to point to the next element.
Definition Iterator.h:98
std::remove_cv_t< T > value_type
Definition Iterator.h:45
friend constexpr Iterator operator+(Iterator i, difference_type n) noexcept
Returns an iterator advanced by n positions.
Definition Iterator.h:163
constexpr Iterator & operator-=(difference_type n) noexcept
Moves the iterator back by n positions.
Definition Iterator.h:152
constexpr reference operator[](difference_type n) const noexcept
Accesses the element n positions away.
Definition Iterator.h:91
T * pointer
Definition Iterator.h:48
constexpr Iterator & operator+=(difference_type n) noexcept
Advances the iterator by n positions.
Definition Iterator.h:142
friend constexpr difference_type operator-(Iterator a, Iterator b) noexcept
Computes the distance between two iterators.
Definition Iterator.h:191
constexpr Iterator & operator--() noexcept
Pre-decrements the iterator to point to the previous element.
Definition Iterator.h:120
friend constexpr auto operator<=>(const Iterator &a, const Iterator &b) noexcept
Three-way compares two iterators by position.
Definition Iterator.h:211
constexpr pointer operator->() const noexcept
Returns the underlying pointer.
Definition Iterator.h:82
constexpr Iterator operator--(int) noexcept
Post-decrements the iterator to point to the previous element.
Definition Iterator.h:131
friend constexpr Iterator operator+(difference_type n, Iterator i) noexcept
Returns an iterator advanced by n positions.
Definition Iterator.h:169
constexpr Iterator() noexcept=default
Constructs a null (singular) iterator.