8 template <
typename base_iterator_t>
14 using value_type = std::remove_reference_t<
15 decltype(*std::declval<typename base_iterator_t::value_type>())>;
16 using reference = value_type&;
17 using pointer = value_type*;
18 using iterator_category = std::forward_iterator_tag;
19 using difference_type = int;
35 value_type& operator*()
const noexcept {
return **it; }
36 value_type* operator->()
const noexcept {
return *it; }
37 bool operator==(
const self_type& rhs)
const noexcept {
return it == rhs.it; }
38 bool operator!=(
const self_type& rhs)
const noexcept {
return it != rhs.it; }
39 bool operator<(
const self_type& rhs)
const noexcept {
return it < rhs.it; }
48 template <
typename base_iterator_t>
54 using value_type = std::remove_reference_t<decltype(*std::declval<base_iterator_t>())>;
55 using reference = value_type&;
56 using pointer = value_type*;
57 using iterator_category = std::forward_iterator_tag;
58 using difference_type = int;
74 auto& operator*()
const noexcept {
return **it; }
75 auto operator->()
const noexcept {
return it; }
76 bool operator==(
const self_type& rhs)
const noexcept {
return it == rhs.it; }
77 bool operator!=(
const self_type& rhs)
const noexcept {
return it != rhs.it; }
78 bool operator<(
const self_type& rhs)
const noexcept {
return it < rhs.it; }
87 template <
typename base_iterator_t>
93 using value_type = std::remove_reference_t<
94 decltype(*std::declval<typename base_iterator_t::value_type::second_type>())>;
95 using reference = value_type&;
96 using pointer = value_type*;
97 using iterator_category = std::forward_iterator_tag;
98 using difference_type = int;
114 auto& operator*()
const noexcept {
return *it->second; }
115 auto operator->()
const noexcept {
return it->second; }
116 bool operator==(
const self_type& rhs)
const noexcept {
return it == rhs.it; }
117 bool operator!=(
const self_type& rhs)
const noexcept {
return it != rhs.it; }
118 bool operator<(
const self_type& rhs)
const noexcept {
return it < rhs.it; }
121 template <
typename T>
127 template <
typename T,
typename U = std::allocator<T*>>
131 using ctnr_t = std::vector<T*, U>;
132 using ctnr_t::ctnr_t;
133 using ctnr_t::reserve;
134 using ctnr_t::resize;
135 using value_type = T;
137 auto begin() noexcept {
return make_indirect_ptr_iterator(ctnr_t::begin()); }
138 auto end() noexcept {
return make_indirect_ptr_iterator(ctnr_t::end()); }
139 auto begin()
const noexcept {
return make_indirect_ptr_iterator(ctnr_t::begin()); }
140 auto end()
const noexcept {
return make_indirect_ptr_iterator(ctnr_t::end()); }
142 auto rbegin() noexcept {
return make_indirect_ptr_iterator(ctnr_t::rbegin()); }
143 auto rend() noexcept {
return make_indirect_ptr_iterator(ctnr_t::rend()); }
144 auto rbegin()
const noexcept {
return make_indirect_ptr_iterator(ctnr_t::rbegin()); }
145 auto rend()
const noexcept {
return make_indirect_ptr_iterator(ctnr_t::rend()); }
147 auto cbegin()
const noexcept {
return make_indirect_ptr_iterator(ctnr_t::cbegin()); }
148 auto cend()
const noexcept {
return make_indirect_ptr_iterator(ctnr_t::cend()); }
150 auto size()
const noexcept {
return ctnr_t::size(); }
151 auto empty()
const noexcept {
return ctnr_t::empty(); }
153 auto push_back(T* ptr) {
return ctnr_t::push_back(ptr); }
155 auto& front()
const noexcept {
return *ctnr_t::front(); }
156 auto& back()
const noexcept {
return *ctnr_t::back(); }
158 auto& operator[](
int pos) noexcept {
return *ctnr_t::operator[](pos); }
159 auto& operator[](
int pos)
const noexcept {
return *ctnr_t::operator[](pos); }
162 template <
class Container>
166 Container& container;
168 auto begin() {
return make_indirect_iterator(container.begin()); }
169 auto end() {
return make_indirect_iterator(container.end()); }
170 auto begin()
const {
return make_indirect_iterator(container.begin()); }
171 auto end()
const {
return make_indirect_iterator(container.end()); }
172 auto cbegin()
const {
return make_indirect_iterator(container.cbegin()); }
173 auto cend()
const {
return make_indirect_iterator(container.cend()); }
176 template <
typename T>
177 auto wrap_indirect(T& container)
182 template <
typename T,
int N>
185 std::array<T*, N> array;
188 using value_type = T;
189 template <
typename... Args>
191 : array{{std::forward<Args>(args)...}}
195 auto begin() noexcept {
return make_indirect_ptr_iterator(array.begin()); }
196 auto end() noexcept {
return make_indirect_ptr_iterator(array.end()); }
197 auto begin()
const noexcept {
return make_indirect_ptr_iterator(array.begin()); }
198 auto end()
const noexcept {
return make_indirect_ptr_iterator(array.end()); }
199 auto cbegin()
const noexcept {
return make_indirect_ptr_iterator(array.cbegin()); }
200 auto cend()
const noexcept {
return make_indirect_ptr_iterator(array.cend()); }
202 auto& operator[](
int pos) noexcept {
return *array[pos]; }
203 auto& operator[](
int pos)
const noexcept {
return *array[pos]; }
206 template <
typename Map_T>
210 auto begin() noexcept {
return make_indirect_iterator(map.begin()); }
211 auto begin()
const noexcept {
return make_indirect_iterator(map.begin()); }
213 auto cbegin() noexcept {
return make_indirect_iterator(map.cbegin()); }
214 auto cbegin()
const noexcept {
return make_indirect_iterator(map.cbegin()); }
216 auto end() noexcept {
return make_indirect_iterator(map.end()); }
217 auto end()
const noexcept {
return make_indirect_iterator(map.end()); }
219 auto cend() noexcept {
return make_indirect_iterator(map.cend()); }
220 auto cend()
const noexcept {
return make_indirect_iterator(map.cend()); }
222 auto empty()
const noexcept {
return map.empty(); }
224 template <
typename K>
225 auto find(K&& key)
const noexcept
227 return map.find(std::forward<K>(key));
230 template <
typename E>
233 return map.insert(std::forward<E>(elt));
240 template <
typename Map_T>
243 using base_iterator_t =
typename Map_T::iterator;
244 using base_const_iterator_t =
typename Map_T::const_iterator;
247 using value_type =
typename base_iterator_t::value_type;
250 auto begin() noexcept {
return make_indirect_map_iterator(map.begin()); }
251 auto begin()
const noexcept {
return make_indirect_map_iterator(map.begin()); }
253 auto cbegin() noexcept {
return make_indirect_map_iterator(map.cbegin()); }
254 auto cbegin()
const noexcept {
return make_indirect_map_iterator(map.cbegin()); }
256 auto end() noexcept {
return make_indirect_map_iterator(map.end()); }
257 auto end()
const noexcept {
return make_indirect_map_iterator(map.end()); }
259 auto cend() noexcept {
return make_indirect_map_iterator(map.cend()); }
260 auto cend()
const noexcept {
return make_indirect_map_iterator(map.cend()); }
262 auto empty()
const noexcept {
return map.empty(); }
264 template <
typename K>
265 auto find(K&& key)
const noexcept
267 return make_indirect_map_iterator(map.find(std::forward<K>(key)));
270 template <
typename E>
273 return map.insert(std::forward<E>(elt));
Definition: IndirectContainer.hpp:184
Definition: IndirectContainer.hpp:129
Definition: IndirectContainer.hpp:164
Definition: IndirectContainer.hpp:208
Definition: IndirectContainer.hpp:242
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: IndirectContainer.hpp:10
Definition: IndirectContainer.hpp:89
Definition: IndirectContainer.hpp:50