Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ah-iterator.H
Go to the documentation of this file.
1
2/*
3 Aleph_w
4
5 Data structures & Algorithms
6 version 2.0.0b
7 https://github.com/lrleon/Aleph-w
8
9 This file is part of Aleph-w library
10
11 Copyright (c) 2002-2026 Leandro Rabindranath Leon
12
13 Permission is hereby granted, free of charge, to any person obtaining a copy
14 of this software and associated documentation files (the "Software"), to deal
15 in the Software without restriction, including without limitation the rights
16 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 copies of the Software, and to permit persons to whom the Software is
18 furnished to do so, subject to the following conditions:
19
20 The above copyright notice and this permission notice shall be included in all
21 copies or substantial portions of the Software.
22
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29 SOFTWARE.
30*/
31
45#ifndef AH_ITERATOR_H
46#define AH_ITERATOR_H
47
48#include <compare>
49#include <iterator>
50#include <concepts>
51#include <type_traits>
52#include <utility>
53
54namespace Aleph
55{
56 // Forward declaration only: extract_from_stl_container() below names
57 // Aleph::DynList in a non-dependent qualified-id, which needs the
58 // namespace and template to be visible even though the function body
59 // is not instantiated until htlist.H's full definition is in scope.
60 template <typename T> class DynList;
61}
62
72template <class I>
73concept AlephRandomAccessItor = requires { typename I::aleph_random_access_iterator; } and
74 std::same_as<typename I::aleph_random_access_iterator, I> and
75 requires(I &it, const I &cit, long n) {
76 { cit.get_pos() } -> std::convertible_to<long>;
77 it.set_pos(n);
78 it.prev();
79 };
80
97template <class SetType>
98struct StlIterator : public SetType::Iterator
99{
100 using T = typename SetType::Item_Type;
101 using Itor = typename SetType::Iterator;
102
107 std::conditional_t<AlephRandomAccessItor<Itor>, std::random_access_iterator_tag, std::forward_iterator_tag>;
109
110 using difference_type = std::ptrdiff_t;
111
112 using reference = decltype(std::declval<const Itor &>().get_curr());
113
114 using pointer = std::add_pointer_t<std::remove_reference_t<reference>>;
115
116 using value_type = T;
117
119 StlIterator() noexcept = default;
120
121 using Itor::Itor;
122
124 StlIterator &operator ++ ()
125 {
126 this->next();
127 return *this;
128 }
129
132 {
133 StlIterator ret_val = *this;
134 this->next();
135 return ret_val;
136 }
137
140 bool operator == (const StlIterator &it) const
141 {
142 if constexpr (requires(const Itor &a, const Itor &b) {
143 { a == b } -> std::convertible_to<bool>;
144 })
145 return static_cast<const Itor &>(*this) == static_cast<const Itor &>(it);
146
147 if (this->has_curr() and it.has_curr())
148 return this->get_pos() == it.get_pos();
149 // return this->get_curr() == it.get_curr();
150
151 if (not this->has_curr() and not it.has_curr())
152 return true;
153
154 return false;
155 }
156
158 bool operator != (const StlIterator &it) const
159 {
160 return not (*this == it);
161 }
162
163 // Note: operator* must be const to satisfy std::indirectly_readable.
164 // Constness of the iterator object does not imply constness of the element.
167 {
168 return this->get_curr();
169 }
170
173 {
174 return &this->get_curr();
175 }
176
177 // Random-access operations. These overloads exist only when the underlying
178 // Aleph iterator opts in via the `aleph_random_access_iterator` marker
179 // (e.g. DynArray, Array). They operate on the logical position exposed by
180 // get_pos()/set_pos(), so any physical/circular index mapping stays internal.
181
185 {
186 this->prev();
187 return *this;
188 }
189
193 {
194 StlIterator ret_val = *this;
195 this->prev();
196 return ret_val;
197 }
198
202 {
203 this->set_pos(this->get_pos() + n);
204 return *this;
205 }
206
210 {
211 this->set_pos(this->get_pos() - n);
212 return *this;
213 }
214
218 {
219 StlIterator ret_val = *this;
220 ret_val += n;
221 return ret_val;
222 }
223
227 {
228 return it + n;
229 }
230
234 {
235 StlIterator ret_val = *this;
236 ret_val -= n;
237 return ret_val;
238 }
239
243 {
244 return static_cast<difference_type>(this->get_pos() - it.get_pos());
245 }
246
250 {
251 StlIterator tmp = *this;
252 tmp += n;
253 return *tmp;
254 }
255
257 std::strong_ordering operator <=> (const StlIterator &it) const
259 {
260 return this->get_pos() <=> it.get_pos();
261 }
262
264 static StlIterator begin(SetType &s)
265 {
266 return StlIterator(s);
267 }
268
270 static StlIterator end(SetType &s)
271 {
272 StlIterator it(s);
273 it.Itor::end();
274 return it;
275 }
276};
277
278namespace Aleph
279{
280
281namespace const_iterator_detail
282{
286 template <class R> struct const_item { using type = R; };
287 template <class T> struct const_item<T &> { using type = const T &; };
288 template <class T> struct const_item<T *> { using type = const T *; };
289 template <class R> using const_item_t = typename const_item<std::remove_cv_t<R>>::type;
290
292 template <class It, class = void> struct item_type_of { };
293 template <class It> struct item_type_of<It, std::void_t<typename It::Item_Type>>
294 {
296 using Item_Type = typename It::Item_Type;
297 };
298
303 template <class It, class = void> struct member_types_of : item_type_of<It> { };
304 template <class It> struct member_types_of<It, std::void_t<typename It::Set_Type>>
305 : item_type_of<It>
306 {
308 using Set_Type = typename It::Set_Type;
309 };
310}
311
335template <class It>
337{
338 // The cursor moves and is read through a constant view: some iterators
339 // read through non-const members, so the view keeps it mutable.
340 mutable It it;
341
342 template <class C>
343 static It make(const C & c)
344 {
345 if constexpr (requires { It(c); })
346 return It(c);
347 else
348 return It(const_cast<C &>(c));
349 }
350
351protected:
357 [[nodiscard]] It & underlying() const noexcept { return it; }
358
359public:
361 using Itor = It;
362
365 std::conditional_t<AlephRandomAccessItor<It>, Const_Iterator, void>;
366
368 Const_Iterator() = default;
369
373 template <class C>
374 requires (not std::same_as<std::remove_cvref_t<C>, Const_Iterator>
375 and not std::same_as<std::remove_cvref_t<C>, It>)
376 explicit Const_Iterator(const C & c) : it(make(c)) {}
377
381 explicit Const_Iterator(It underlying) noexcept(std::is_nothrow_move_constructible_v<It>)
382 : it(std::move(underlying)) {}
383
385 template <class I = It>
386 [[nodiscard]] auto has_curr() const noexcept(noexcept(std::declval<I &>().has_curr()))
387 -> decltype(std::declval<I &>().has_curr())
388 {
389 return it.has_curr();
390 }
391
397 template <class I = It>
398 [[nodiscard]] auto get_curr() const noexcept(noexcept(std::declval<I &>().get_curr()))
399 -> const_iterator_detail::const_item_t<decltype(std::declval<I &>().get_curr())>
400 {
401 return it.get_curr();
402 }
403
405 template <class I = It>
406 [[nodiscard]] auto get_curr_ne() const noexcept(noexcept(std::declval<I &>().get_curr_ne()))
407 -> const_iterator_detail::const_item_t<decltype(std::declval<I &>().get_curr_ne())>
408 {
409 return it.get_curr_ne();
410 }
411
413 template <class I = It>
414 auto next() noexcept(noexcept(std::declval<I &>().next())) -> decltype(std::declval<I &>().next())
415 {
416 return it.next();
417 }
418
420 template <class I = It>
421 auto next_ne() noexcept(noexcept(std::declval<I &>().next_ne())) -> decltype(std::declval<I &>().next_ne())
422 {
423 return it.next_ne();
424 }
425
427 template <class I = It>
428 auto prev() noexcept(noexcept(std::declval<I &>().prev())) -> decltype(std::declval<I &>().prev())
429 {
430 return it.prev();
431 }
432
434 template <class I = It>
435 auto prev_ne() noexcept(noexcept(std::declval<I &>().prev_ne())) -> decltype(std::declval<I &>().prev_ne())
436 {
437 return it.prev_ne();
438 }
439
441 template <class I = It>
442 auto reset_first() noexcept(noexcept(std::declval<I &>().reset_first()))
443 -> decltype(std::declval<I &>().reset_first())
444 {
445 return it.reset_first();
446 }
447
449 template <class I = It>
450 auto reset_last() noexcept(noexcept(std::declval<I &>().reset_last()))
451 -> decltype(std::declval<I &>().reset_last())
452 {
453 return it.reset_last();
454 }
455
457 template <class I = It>
458 auto reset() noexcept(noexcept(std::declval<I &>().reset())) -> decltype(std::declval<I &>().reset())
459 {
460 return it.reset();
461 }
462
464 template <class I = It>
465 auto end() noexcept(noexcept(std::declval<I &>().end())) -> decltype(std::declval<I &>().end())
466 {
467 return it.end();
468 }
469
471 template <class I = It>
472 [[nodiscard]] auto get_pos() const noexcept(noexcept(std::declval<I &>().get_pos()))
473 -> decltype(std::declval<I &>().get_pos())
474 {
475 return it.get_pos();
476 }
477
479 template <class I = It>
480 auto set_pos(const long pos) noexcept(noexcept(std::declval<I &>().set_pos(pos)))
481 -> decltype(std::declval<I &>().set_pos(pos))
482 {
483 return it.set_pos(pos);
484 }
485
487 template <class I = It>
488 [[nodiscard]] auto is_last() const noexcept(noexcept(std::declval<I &>().is_last()))
489 -> decltype(std::declval<I &>().is_last())
490 {
491 return it.is_last();
492 }
493
495 template <class I = It>
496 [[nodiscard]] auto is_in_first() const noexcept(noexcept(std::declval<I &>().is_in_first()))
497 -> decltype(std::declval<I &>().is_in_first())
498 {
499 return it.is_in_first();
500 }
501
503 template <class I = It>
504 [[nodiscard]] auto is_in_last() const noexcept(noexcept(std::declval<I &>().is_in_last()))
505 -> decltype(std::declval<I &>().is_in_last())
506 {
507 return it.is_in_last();
508 }
509
511 void swap(Const_Iterator & other) noexcept(std::is_nothrow_swappable_v<It>)
512 {
513 using std::swap;
514 swap(it, other.it);
515 }
516
518 template <class I = It>
519 [[nodiscard]] auto operator == (const Const_Iterator & other) const
520 -> decltype(std::declval<I &>() == std::declval<I &>())
521 {
522 return it == other.it;
523 }
524
526 template <class I = It>
527 [[nodiscard]] auto operator != (const Const_Iterator & other) const
528 -> decltype(not (std::declval<I &>() == std::declval<I &>()))
529 {
530 return not (it == other.it);
531 }
532};
533
537template <class C>
539
545template <class C>
546 requires (not std::is_const_v<C>)
547[[nodiscard]] auto iterator_for(C & c)
548{
549 return typename C::Iterator(c);
550}
551
557template <class C>
558[[nodiscard]] auto iterator_for(const C & c)
559{
560 return const_iterator_t<C>(c);
561}
562
563} // end namespace Aleph
564
571template <class SetType>
572struct StlConstIterator : public Aleph::Const_Iterator<typename SetType::Iterator>
573{
574 using T = typename SetType::Item_Type;
575 using Itor = typename SetType::Iterator;
577
582 std::conditional_t<AlephRandomAccessItor<Itor>, std::random_access_iterator_tag, std::forward_iterator_tag>;
584
585 using difference_type = std::ptrdiff_t;
586
587 using pointer = const T *;
588
589 using reference = const T &;
590
591 using value_type = T;
592
594 StlConstIterator() noexcept = default;
595
597 StlConstIterator(const SetType &s) : Base(s) {}
598
601 {
602 this->next();
603 return *this;
604 }
605
608 {
609 StlConstIterator ret_val = *this;
610 this->next();
611 return ret_val;
612 }
613
617 {
618 if constexpr (requires(const Base &a, const Base &b) {
619 { a == b } -> std::convertible_to<bool>;
620 })
621 return static_cast<const Base &>(*this) == static_cast<const Base &>(it);
622
623 if (this->has_curr() and it.has_curr())
624 return this->get_pos() == it.get_pos();
625
626 if (not this->has_curr() and not it.has_curr())
627 return true;
628
629 return false;
630 }
631
634 {
635 return not (*this == it);
636 }
637
639 const T &operator * () const
640 {
641 return this->get_curr();
642 }
643
645 const T *operator ->() const
646 {
647 return &this->get_curr();
648 }
649
650 // Random-access operations, mirroring StlIterator. These overloads exist
651 // only when the underlying Aleph iterator opts in via the
652 // `aleph_random_access_iterator` marker (e.g. DynArray, Array). They operate
653 // on the logical position exposed by get_pos()/set_pos(), so any
654 // physical/circular index mapping stays internal.
655
659 {
660 this->prev();
661 return *this;
662 }
663
667 {
668 StlConstIterator ret_val = *this;
669 this->prev();
670 return ret_val;
671 }
672
676 {
677 this->set_pos(this->get_pos() + n);
678 return *this;
679 }
680
684 {
685 this->set_pos(this->get_pos() - n);
686 return *this;
687 }
688
692 {
693 StlConstIterator ret_val = *this;
694 ret_val += n;
695 return ret_val;
696 }
697
701 {
702 return it + n;
703 }
704
708 {
709 StlConstIterator ret_val = *this;
710 ret_val -= n;
711 return ret_val;
712 }
713
717 {
718 return static_cast<difference_type>(this->get_pos() - it.get_pos());
719 }
720
724 {
725 StlConstIterator tmp = *this;
726 tmp += n;
727 return *tmp;
728 }
729
731 std::strong_ordering operator <=> (const StlConstIterator &it) const
733 {
734 return this->get_pos() <=> it.get_pos();
735 }
736
738 static StlConstIterator cbegin(const SetType &s)
739 {
740 return StlConstIterator(s);
741 }
742
744 static StlConstIterator cend(const SetType &s)
745 {
747 it.end();
748 return it;
749 }
750};
751
759template <class SetName>
761{
762 SetName *me()
763 {
764 return static_cast<SetName *>(this);
765 }
766
767 const SetName *const_me() const
768 {
769 return static_cast<const SetName *>(this);
770 }
771
772public:
774
776
778 iterator begin() noexcept
779 {
780 return iterator::begin(*me());
781 }
782
784 iterator end() noexcept
785 {
786 return iterator::end(*me());
787 }
788
790 const_iterator begin() const noexcept
791 {
793 }
794
796 const_iterator end() const noexcept
797 {
799 }
800
802 const_iterator cbegin() const noexcept
803 {
805 }
806
808 const_iterator cend() const noexcept
809 {
811 }
812
813 friend const_iterator cbegin(const SetName &s) noexcept
814 {
815 return s.begin();
816 }
817
818 friend const_iterator cend(const SetName &s) noexcept
819 {
820 return s.end();
821 }
822
823 friend const_iterator begin(const SetName &s) noexcept
824 {
825 return s.begin();
826 }
827
828 friend const_iterator end(const SetName &s) noexcept
829 {
830 return s.end();
831 }
832
833 friend iterator begin(SetName &s) noexcept
834 {
835 return s.begin();
836 }
837
838 friend iterator end(SetName &s) noexcept
839 {
840 return s.end();
841 }
842};
843
852template <class Container>
854{
856 for (const auto &i : c)
857 ret.append(i);
858 return ret;
859}
860
861#endif // AH_ITERATOR_H
Aleph::DynList< typename Container::value_type > extract_from_stl_container(const Container &c)
Extract all items from an STL container into an Aleph DynList.
Read-only view of an Aleph iterator: the iterator of a constant container.
It & underlying() const noexcept
The underlying iterator, for the views that extend the reading protocol with members of their own (th...
auto reset_first() noexcept(noexcept(std::declval< I & >().reset_first())) -> decltype(std::declval< I & >().reset_first())
Position the view on the first item.
auto is_in_last() const noexcept(noexcept(std::declval< I & >().is_in_last())) -> decltype(std::declval< I & >().is_in_last())
true if the current item is the last one.
Const_Iterator(const C &c)
View positioned on the first item of the container c.
auto operator==(const Const_Iterator &other) const -> decltype(std::declval< I & >()==std::declval< I & >())
Equality of the underlying iterators, when they have it.
std::conditional_t< AlephRandomAccessItor< It >, Const_Iterator, void > aleph_random_access_iterator
Random access when the underlying iterator opts in; see AlephRandomAccessItor.
auto reset_last() noexcept(noexcept(std::declval< I & >().reset_last())) -> decltype(std::declval< I & >().reset_last())
Position the view on the last item.
auto get_pos() const noexcept(noexcept(std::declval< I & >().get_pos())) -> decltype(std::declval< I & >().get_pos())
Ordinal position of the current item.
auto prev() noexcept(noexcept(std::declval< I & >().prev())) -> decltype(std::declval< I & >().prev())
Move to the previous item; what the underlying iterator throws.
auto reset() noexcept(noexcept(std::declval< I & >().reset())) -> decltype(std::declval< I & >().reset())
Position the view on the first item.
auto is_in_first() const noexcept(noexcept(std::declval< I & >().is_in_first())) -> decltype(std::declval< I & >().is_in_first())
true if the current item is the first one.
void swap(Const_Iterator &other) noexcept(std::is_nothrow_swappable_v< It >)
Exchange the views.
auto end() noexcept(noexcept(std::declval< I & >().end())) -> decltype(std::declval< I & >().end())
Position the view past the last item.
static It make(const C &c)
auto next() noexcept(noexcept(std::declval< I & >().next())) -> decltype(std::declval< I & >().next())
Move to the next item; what the underlying iterator throws.
Const_Iterator()=default
A view with no current item.
auto has_curr() const noexcept(noexcept(std::declval< I & >().has_curr())) -> decltype(std::declval< I & >().has_curr())
true if there is a current item.
auto is_last() const noexcept(noexcept(std::declval< I & >().is_last())) -> decltype(std::declval< I & >().is_last())
true if the current item is the last one.
auto operator!=(const Const_Iterator &other) const -> decltype(not(std::declval< I & >()==std::declval< I & >()))
Negation of ==.
auto set_pos(const long pos) noexcept(noexcept(std::declval< I & >().set_pos(pos))) -> decltype(std::declval< I & >().set_pos(pos))
Position the view on the item at ordinal position pos.
auto get_curr_ne() const noexcept(noexcept(std::declval< I & >().get_curr_ne())) -> const_iterator_detail::const_item_t< decltype(std::declval< I & >().get_curr_ne())>
get_curr() without the checks of the underlying iterator.
auto get_curr() const noexcept(noexcept(std::declval< I & >().get_curr())) -> const_iterator_detail::const_item_t< decltype(std::declval< I & >().get_curr())>
The current item, read-only.
It Itor
The underlying iterator.
Const_Iterator(It underlying) noexcept(std::is_nothrow_move_constructible_v< It >)
Read-only view over an existing iterator.
auto next_ne() noexcept(noexcept(std::declval< I & >().next_ne())) -> decltype(std::declval< I & >().next_ne())
next() without checks.
auto prev_ne() noexcept(noexcept(std::declval< I & >().prev_ne())) -> decltype(std::declval< I & >().prev_ne())
prev() without checks.
Doubly-linked list (defined in tpl_dynList.H).
Definition htlist.H:1231
T & append(const T &item)
Definition htlist.H:1362
Mixin that adds STL begin()/end() and cbegin()/cend() to Aleph containers.
friend const_iterator end(const SetName &s) noexcept
const_iterator begin() const noexcept
Return a const iterator to the first element.
friend const_iterator cbegin(const SetName &s) noexcept
friend const_iterator cend(const SetName &s) noexcept
SetName * me()
const_iterator cbegin() const noexcept
Return a const iterator to the first element.
const_iterator cend() const noexcept
Return a const end iterator.
friend iterator end(SetName &s) noexcept
const SetName * const_me() const
friend iterator begin(SetName &s) noexcept
iterator end() noexcept
Return an STL-compatible end iterator.
const_iterator end() const noexcept
Return a const end iterator.
friend const_iterator begin(const SetName &s) noexcept
iterator begin() noexcept
Return an STL-compatible iterator to the first element.
Detects Aleph iterators that opted in to random-access promotion.
Definition ah-iterator.H:73
typename const_item< std::remove_cv_t< R > >::type const_item_t
Main namespace for Aleph-w library functions.
std::decay_t< typename HeadC::Item_Type > T
Definition ah-zip.H:152
and
Check uniqueness with explicit hash + equality functors.
auto iterator_for(C &c)
Iterator on c positioned on its first item: the container's own iterator on a modifiable container.
STL namespace.
What a read-only view hands out for an item handed out as R: a reference becomes a reference to const...
typename It::Item_Type Item_Type
The type of the items, as in the underlying iterator.
Carries the Item_Type of the iterator It, when it has one.
typename It::Set_Type Set_Type
The type of the container, as in the underlying iterator.
Carries the Set_Type of the iterator It, when it has one, on top of its Item_Type.
STL-compatible const iterator adapter for Aleph containers.
const T & operator*() const
Dereference: return the current element.
StlConstIterator() noexcept=default
Default constructor creates an "end" iterator (no current element).
typename SetType::Iterator Itor
typename SetType::Item_Type T
static StlConstIterator cbegin(const SetType &s)
Create a const iterator positioned at the first element of the container.
friend StlConstIterator operator+(difference_type n, const StlConstIterator &it)
Return an iterator advanced n positions (symmetric form).
const T * operator->() const
Member access to the current element.
const T * pointer
bool operator==(const StlConstIterator &it) const
Equality compares positions when both iterators are valid; otherwise both must be in the end state.
std::strong_ordering operator<=>(const StlConstIterator &it) const
Order two iterators by their logical position.
std::ptrdiff_t difference_type
std::conditional_t< AlephRandomAccessItor< Itor >, std::random_access_iterator_tag, std::forward_iterator_tag > iterator_category
Category is promoted to random-access when the underlying Aleph iterator opts in (see AlephRandomAcce...
bool operator!=(const StlConstIterator &it) const
Inequality.
StlConstIterator & operator++()
Pre-increment: advance to the next element.
static StlConstIterator cend(const SetType &s)
Create a const end iterator for the container.
iterator_category iterator_concept
const T & reference
StlConstIterator operator-(difference_type n) const
Return an iterator moved back n positions.
StlConstIterator & operator--()
Pre-decrement: move to the previous element.
reference operator[](difference_type n) const
Access the element n positions away from the current one.
StlConstIterator & operator+=(difference_type n)
Advance the iterator n positions (n may be negative).
StlConstIterator & operator-=(difference_type n)
Move the iterator back n positions (n may be negative).
STL-compatible mutable iterator adapter for Aleph containers.
Definition ah-iterator.H:99
std::add_pointer_t< std::remove_reference_t< reference > > pointer
std::strong_ordering operator<=>(const StlIterator &it) const
Order two iterators by their logical position.
bool operator!=(const StlIterator &it) const
Inequality.
friend StlIterator operator+(difference_type n, const StlIterator &it)
Return an iterator advanced n positions (symmetric form).
decltype(std::declval< const Itor & >().get_curr()) reference
typename SetType::Iterator Itor
std::ptrdiff_t difference_type
static StlIterator begin(SetType &s)
Create an iterator positioned at the first element of the container.
StlIterator & operator-=(difference_type n)
Move the iterator back n positions (n may be negative).
StlIterator operator-(difference_type n) const
Return an iterator moved back n positions.
std::conditional_t< AlephRandomAccessItor< Itor >, std::random_access_iterator_tag, std::forward_iterator_tag > iterator_category
Category is promoted to random-access when the underlying Aleph iterator opts in (see AlephRandomAcce...
StlIterator & operator+=(difference_type n)
Advance the iterator n positions (n may be negative).
static StlIterator end(SetType &s)
Create an end iterator for the container.
StlIterator() noexcept=default
Default constructor creates an "end" iterator (no current element).
pointer operator->() const
Member access to the current element.
StlIterator & operator++()
Pre-increment: advance to the next element.
bool operator==(const StlIterator &it) const
Equality compares positions when both iterators are valid; otherwise both must be in the end state.
iterator_category iterator_concept
reference operator*() const
Dereference: return the current element.
typename SetType::Item_Type T
reference operator[](difference_type n) const
Access the element n positions away from the current one.
StlIterator & operator--()
Pre-decrement: move to the previous element.
Filter_Iterator< DynList< int >, DynList< int >::Iterator, Par > It
Definition test_htlist.C:61