4#ifndef _Stroika_Foundation_Traversal_RandomAccessIterator_h_
5#define _Stroika_Foundation_Traversal_RandomAccessIterator_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
9#include "Stroika/Foundation/Common/Common.h"
18namespace Stroika::Foundation::Traversal {
28 template <
typename T,
typename ITERATOR_TRAITS = Support::DefaultIteratorTraits<T>>
37 using difference_type =
typename inherited::difference_type;
38 using value_type =
typename inherited::value_type;
39 using pointer =
typename inherited::pointer;
40 using reference =
typename inherited::reference;
90 nonvirtual
void Advance (difference_type i);
164 nonvirtual const T& operator[] (difference_type i) const;
184 template <typename T2, typename ITERATOR_TRAITS2>
195 template <typename T2, typename ITERATOR_TRAITS2>
230 template <typename T, typename ITERATOR_TRAITS>
266 static_assert (random_access_iterator<RandomAccessIterator<int>>);
267 static_assert (regular<RandomAccessIterator<int>>);
268 static_assert (sentinel_for<default_sentinel_t, RandomAccessIterator<int>>);
280#include "RandomAccessIterator.inl"
A BidirectionalIterator is an Iterator that can be moved both forward and backward.
The interface for the internal representation of a RandomAccessIterator.
virtual ptrdiff_t Difference(const IRep *rhs) const =0
Calculate the difference between this iterator and another.
virtual void Advance(ptrdiff_t i)=0
Advance the iterator by the specified number of positions (which CAN be negative).
virtual const T * PeekAtElement(ptrdiff_t i) const =0
Peek at the element at the specified position.
nonvirtual IRep & GetRep()
Get a reference to the IRep owned by the iterator. This is an implementation detail,...
nonvirtual const IRep & ConstGetRep() const
Get a reference to the IRep owned by the iterator. This is an implementation detail,...
random_access_iterator_tag iterator_category
iterator_category = random_access_iterator_tag;
nonvirtual difference_type Difference(const RandomAccessIterator &rhs) const
Calculate the difference between this iterator and another.
nonvirtual void Advance(difference_type i)
Advance the iterator by the specified number of positions (which may be negative)....