qxLib
iterator.inl
Go to the documentation of this file.
1 /**
2 
3  @file iterator.inl
4  @author Khrapov
5  @date 14.10.2026
6  @copyright (c) Nick Khrapov, 2026. All right reserved.
7 
8 **/
9 
10 namespace qx
11 {
12 
13 template<class container_t, class derived_t>
14 [[nodiscard]] constexpr typename iterator<container_t, derived_t>::super_type::reference iterator<
15  container_t,
16  derived_t>::operator*() const noexcept
17 {
18  return super_type::get();
19 }
20 
21 template<class container_t, class derived_t>
22 [[nodiscard]] constexpr typename iterator<container_t, derived_t>::super_type::pointer iterator<
23  container_t,
24  derived_t>::operator->() const noexcept
25 {
26  return &super_type::get();
27 }
28 
29 template<class container_t, class derived_t>
30 [[nodiscard]] constexpr typename iterator<container_t, derived_t>::super_type::reference iterator<
31  container_t,
32  derived_t>::operator[](typename super_type::size_type i) const noexcept
33 {
34  return super_type::get(i);
35 }
36 
37 template<class container_t, class derived_t>
38 constexpr const_iterator<container_t, derived_t>::const_iterator(const iterator<container_t>& it) noexcept
39  : super_type(it.m_pContainer, it.m_nIndex)
40 {
41 }
42 
43 template<class container_t, class derived_t>
44 [[nodiscard]] constexpr typename const_iterator<container_t, derived_t>::super_type::const_reference const_iterator<
45  container_t,
46  derived_t>::operator*() const noexcept
47 {
48  return super_type::get();
49 }
50 
51 template<class container_t, class derived_t>
52 [[nodiscard]] constexpr typename const_iterator<container_t, derived_t>::super_type::const_pointer const_iterator<
53  container_t,
54  derived_t>::operator->() const noexcept
55 {
56  return &super_type::get();
57 }
58 
59 template<class container_t, class derived_t>
60 [[nodiscard]] constexpr typename const_iterator<container_t, derived_t>::super_type::const_reference const_iterator<
61  container_t,
62  derived_t>::operator[](typename super_type::size_type m) const noexcept
63 {
64  return super_type::get(m);
65 }
66 
67 template<class container_t, class derived_t>
68 [[nodiscard]] constexpr typename reverse_iterator<container_t, derived_t>::super_type::reference reverse_iterator<
69  container_t,
70  derived_t>::operator*() const noexcept
71 {
72  return super_type::get();
73 }
74 
75 template<class container_t, class derived_t>
76 [[nodiscard]] constexpr typename reverse_iterator<container_t, derived_t>::super_type::pointer reverse_iterator<
77  container_t,
78  derived_t>::operator->() const noexcept
79 {
80  return &super_type::get();
81 }
82 
83 template<class container_t, class derived_t>
84 [[nodiscard]] constexpr typename reverse_iterator<container_t, derived_t>::super_type::reference reverse_iterator<
85  container_t,
86  derived_t>::operator[](typename super_type::size_type m) const noexcept
87 {
88  return super_type::get(m);
89 }
90 
91 template<class container_t, class derived_t>
92 constexpr const_reverse_iterator<container_t, derived_t>::const_reverse_iterator(
93  const reverse_iterator<container_t>& it) noexcept
94  : super_type(it.m_pContainer, it.m_nIndex)
95 {
96 }
97 
98 template<class container_t, class derived_t>
99 [[nodiscard]] constexpr typename const_reverse_iterator<container_t, derived_t>::super_type::const_reference
100  const_reverse_iterator<container_t, derived_t>::operator*() const noexcept
101 {
102  return super_type::get();
103 }
104 
105 template<class container_t, class derived_t>
106 [[nodiscard]] constexpr typename const_reverse_iterator<container_t, derived_t>::super_type::const_pointer
107  const_reverse_iterator<container_t, derived_t>::operator->() const noexcept
108 {
109  return &super_type::get();
110 }
111 
112 template<class container_t, class derived_t>
113 [[nodiscard]] constexpr typename const_reverse_iterator<container_t, derived_t>::super_type::const_reference
114  const_reverse_iterator<container_t, derived_t>::operator[](typename super_type::size_type m) const noexcept
115 {
116  return super_type::get(m);
117 }
118 
119 } // namespace qx