6namespace Stroika::Foundation::Traversal {
13 template <
typename T,
typename ITERATOR_TRAITS>
18 template <
typename T,
typename ITERATOR_TRAITS>
19 inline BidirectionalIterator<T, ITERATOR_TRAITS>::BidirectionalIterator (unique_ptr<IRep>&& rep) noexcept
20 : inherited{move (rep)}
23 template <
typename T,
typename ITERATOR_TRAITS>
24 constexpr BidirectionalIterator<T, ITERATOR_TRAITS>::BidirectionalIterator (
const default_sentinel_t&) noexcept
25 : inherited{default_sentinel}
28 template <
typename T,
typename ITERATOR_TRAITS>
29 constexpr BidirectionalIterator<T, ITERATOR_TRAITS>::BidirectionalIterator (nullptr_t) noexcept
33 template <
typename T,
typename ITERATOR_TRAITS>
34 constexpr BidirectionalIterator<T, ITERATOR_TRAITS>::BidirectionalIterator () noexcept
38 template <
typename T,
typename ITERATOR_TRAITS>
39 inline bool BidirectionalIterator<T, ITERATOR_TRAITS>::AtStart ()
const
41 return ConstGetRep ().AtStart ();
43 template <
typename T,
typename ITERATOR_TRAITS>
46 inherited::operator++ ();
49 template <
typename T,
typename ITERATOR_TRAITS>
53 inherited::operator++ ();
56 template <
typename T,
typename ITERATOR_TRAITS>
59 Require (not this->AtStart ());
60 this->_fCurrentValue = GetRep ().Back ();
63 template <
typename T,
typename ITERATOR_TRAITS>
70 template <
typename T,
typename ITERATOR_TRAITS>
75 for (ptrdiff_t j = 0; j < i; ++j) {
80 template <
typename T,
typename ITERATOR_TRAITS>
83 return Debug::UncheckedDynamicCast<IRep&> (inherited::GetRep ());
85 template <
typename T,
typename ITERATOR_TRAITS>
88 return Debug::UncheckedDynamicCast<const IRep&> (inherited::ConstGetRep ());
An Iterator<T> that also supports going backwards.
A BidirectionalIterator is an Iterator that can be moved both forward and backward.
nonvirtual const IRep & ConstGetRep() const
Get a reference to the IRep owned by the iterator. This is an implementation detail,...
nonvirtual IRep & GetRep()
Get a reference to the IRep owned by the iterator. This is an implementation detail,...
nonvirtual BidirectionalIterator & operator++()
same as Iterator::operator++ () - advances iterator - but returns the subclass iterator type.
nonvirtual BidirectionalIterator operator-(ptrdiff_t i) const
Move the iterator back by the specified number of positions.
nonvirtual BidirectionalIterator & operator--()
An Iterator<T> is a copyable object which allows traversing the contents of some container.