40 using derived_type = D;
43 using inner_shape_type =
typename iterable_types::inner_shape_type;
45 using stepper =
typename iterable_types::stepper;
46 using const_stepper =
typename iterable_types::const_stepper;
48 template <layout_type L>
50 template <layout_type L>
52 template <layout_type L>
53 using reverse_layout_iterator = std::reverse_iterator<layout_iterator<L>>;
54 template <layout_type L>
55 using const_reverse_layout_iterator = std::reverse_iterator<const_layout_iterator<L>>;
57 using linear_iterator = layout_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
58 using const_linear_iterator = const_layout_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
59 using reverse_linear_iterator = reverse_layout_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
60 using const_reverse_linear_iterator = const_reverse_layout_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
62 template <
class S, layout_type L>
64 template <
class S, layout_type L>
66 template <
class S, layout_type L>
67 using reverse_broadcast_iterator = std::reverse_iterator<broadcast_iterator<S, L>>;
68 template <
class S, layout_type L>
69 using const_reverse_broadcast_iterator = std::reverse_iterator<const_broadcast_iterator<S, L>>;
71 using iterator = layout_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
72 using const_iterator = const_layout_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
73 using reverse_iterator = reverse_layout_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
74 using const_reverse_iterator = const_reverse_layout_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
76 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
77 const_layout_iterator<L> begin()
const noexcept;
78 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
79 const_layout_iterator<L> end()
const noexcept;
80 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
81 const_layout_iterator<L> cbegin()
const noexcept;
82 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
83 const_layout_iterator<L> cend()
const noexcept;
85 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
86 const_reverse_layout_iterator<L> rbegin()
const noexcept;
87 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
88 const_reverse_layout_iterator<L> rend()
const noexcept;
89 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
90 const_reverse_layout_iterator<L> crbegin()
const noexcept;
91 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
92 const_reverse_layout_iterator<L> crend()
const noexcept;
94 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
95 const_broadcast_iterator<S, L> begin(
const S& shape)
const noexcept;
96 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
97 const_broadcast_iterator<S, L> end(
const S& shape)
const noexcept;
98 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
99 const_broadcast_iterator<S, L> cbegin(
const S& shape)
const noexcept;
100 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
101 const_broadcast_iterator<S, L> cend(
const S& shape)
const noexcept;
103 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
104 const_reverse_broadcast_iterator<S, L> rbegin(
const S& shape)
const noexcept;
105 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
106 const_reverse_broadcast_iterator<S, L> rend(
const S& shape)
const noexcept;
107 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
108 const_reverse_broadcast_iterator<S, L> crbegin(
const S& shape)
const noexcept;
109 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
110 const_reverse_broadcast_iterator<S, L> crend(
const S& shape)
const noexcept;
114 const inner_shape_type& get_shape()
const;
118 template <layout_type L>
119 const_layout_iterator<L> get_cbegin(
bool end_index)
const noexcept;
120 template <layout_type L>
121 const_layout_iterator<L> get_cend(
bool end_index)
const noexcept;
123 template <layout_type L,
class S>
124 const_broadcast_iterator<S, L> get_cbegin(
const S& shape,
bool end_index)
const noexcept;
125 template <layout_type L,
class S>
126 const_broadcast_iterator<S, L> get_cend(
const S& shape,
bool end_index)
const noexcept;
129 const_stepper get_stepper_begin(
const S& shape)
const noexcept;
131 const_stepper get_stepper_end(
const S& shape,
layout_type l)
const noexcept;
133 const derived_type& derived_cast()
const;
155 using derived_type = D;
158 using inner_shape_type =
typename base_type::inner_shape_type;
160 using stepper =
typename base_type::stepper;
161 using const_stepper =
typename base_type::const_stepper;
163 using linear_iterator =
typename base_type::linear_iterator;
164 using reverse_linear_iterator =
typename base_type::reverse_linear_iterator;
166 template <layout_type L>
167 using layout_iterator =
typename base_type::template layout_iterator<L>;
168 template <layout_type L>
169 using const_layout_iterator =
typename base_type::template const_layout_iterator<L>;
170 template <layout_type L>
171 using reverse_layout_iterator =
typename base_type::template reverse_layout_iterator<L>;
172 template <layout_type L>
173 using const_reverse_layout_iterator =
typename base_type::template const_reverse_layout_iterator<L>;
175 template <
class S, layout_type L>
176 using broadcast_iterator =
typename base_type::template broadcast_iterator<S, L>;
177 template <
class S, layout_type L>
178 using const_broadcast_iterator =
typename base_type::template const_broadcast_iterator<S, L>;
179 template <
class S, layout_type L>
180 using reverse_broadcast_iterator =
typename base_type::template reverse_broadcast_iterator<S, L>;
181 template <
class S, layout_type L>
182 using const_reverse_broadcast_iterator =
typename base_type::template const_reverse_broadcast_iterator<S, L>;
184 using iterator =
typename base_type::iterator;
185 using const_iterator =
typename base_type::const_iterator;
186 using reverse_iterator =
typename base_type::reverse_iterator;
187 using const_reverse_iterator =
typename base_type::const_reverse_iterator;
189 using base_type::begin;
190 using base_type::end;
191 using base_type::rbegin;
192 using base_type::rend;
194 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
195 layout_iterator<L> begin()
noexcept;
196 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
197 layout_iterator<L> end()
noexcept;
199 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
200 reverse_layout_iterator<L> rbegin()
noexcept;
201 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
202 reverse_layout_iterator<L> rend()
noexcept;
204 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
205 broadcast_iterator<S, L> begin(
const S& shape)
noexcept;
206 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
207 broadcast_iterator<S, L> end(
const S& shape)
noexcept;
209 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
210 reverse_broadcast_iterator<S, L> rbegin(
const S& shape)
noexcept;
211 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
212 reverse_broadcast_iterator<S, L> rend(
const S& shape)
noexcept;
216 template <layout_type L>
217 layout_iterator<L> get_begin(
bool end_index)
noexcept;
218 template <layout_type L>
219 layout_iterator<L> get_end(
bool end_index)
noexcept;
221 template <layout_type L,
class S>
222 broadcast_iterator<S, L> get_begin(
const S& shape,
bool end_index)
noexcept;
223 template <layout_type L,
class S>
224 broadcast_iterator<S, L> get_end(
const S& shape,
bool end_index)
noexcept;
227 stepper get_stepper_begin(
const S& shape)
noexcept;
229 stepper get_stepper_end(
const S& shape,
layout_type l)
noexcept;
232 const_stepper get_stepper_begin(
const S& shape)
const noexcept;
234 const_stepper get_stepper_end(
const S& shape,
layout_type l)
const noexcept;
236 derived_type& derived_cast();
315 using derived_type = D;
320 using stepper =
typename iterable_base::stepper;
321 using const_stepper =
typename iterable_base::const_stepper;
323 static constexpr layout_type static_layout = inner_types::layout;
325#if defined(_MSC_VER) && _MSC_VER >= 1910
328 template <layout_type L>
330 template <layout_type L>
332 typename iterable_base::const_stepper,
333 typename iterable_base::inner_shape_type*,
335 template <layout_type L>
336 using reverse_layout_iterator = std::reverse_iterator<layout_iterator<L>>;
337 template <layout_type L>
338 using const_reverse_layout_iterator = std::reverse_iterator<const_layout_iterator<L>>;
340 template <layout_type L>
341 using layout_iterator =
typename iterable_base::template layout_iterator<L>;
342 template <layout_type L>
343 using const_layout_iterator =
typename iterable_base::template const_layout_iterator<L>;
344 template <layout_type L>
345 using reverse_layout_iterator =
typename iterable_base::template reverse_layout_iterator<L>;
346 template <layout_type L>
347 using const_reverse_layout_iterator =
typename iterable_base::template const_reverse_layout_iterator<L>;
350 template <
class S, layout_type L>
351 using broadcast_iterator =
typename iterable_base::template broadcast_iterator<S, L>;
352 template <
class S, layout_type L>
353 using const_broadcast_iterator =
typename iterable_base::template const_broadcast_iterator<S, L>;
354 template <
class S, layout_type L>
355 using reverse_broadcast_iterator =
typename iterable_base::template reverse_broadcast_iterator<S, L>;
356 template <
class S, layout_type L>
357 using const_reverse_broadcast_iterator =
typename iterable_base::template const_reverse_broadcast_iterator<S, L>;
359 using linear_traits = detail::linear_iterator_traits<D>;
360 using linear_iterator =
typename linear_traits::linear_iterator;
361 using const_linear_iterator =
typename linear_traits::const_linear_iterator;
362 using reverse_linear_iterator =
typename linear_traits::reverse_linear_iterator;
363 using const_reverse_linear_iterator =
typename linear_traits::const_reverse_linear_iterator;
365 template <layout_type L,
class It1,
class It2>
366 using select_iterator_impl = std::conditional_t<L == static_layout, It1, It2>;
368 template <layout_type L>
369 using select_iterator = select_iterator_impl<L, linear_iterator, layout_iterator<L>>;
370 template <layout_type L>
371 using select_const_iterator = select_iterator_impl<L, const_linear_iterator, const_layout_iterator<L>>;
372 template <layout_type L>
373 using select_reverse_iterator = select_iterator_impl<L, reverse_linear_iterator, reverse_layout_iterator<L>>;
374 template <layout_type L>
375 using select_const_reverse_iterator = select_iterator_impl<
377 const_reverse_linear_iterator,
378 const_reverse_layout_iterator<L>>;
380 using iterator = select_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
381 using const_iterator = select_const_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
382 using reverse_iterator = select_reverse_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
383 using const_reverse_iterator = select_const_reverse_iterator<XTENSOR_DEFAULT_TRAVERSAL>;
385 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
386 select_iterator<L> begin()
noexcept;
387 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
388 select_iterator<L> end()
noexcept;
390 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
391 select_const_iterator<L> begin()
const noexcept;
392 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
393 select_const_iterator<L> end()
const noexcept;
394 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
395 select_const_iterator<L> cbegin()
const noexcept;
396 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
397 select_const_iterator<L> cend()
const noexcept;
399 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
400 select_reverse_iterator<L> rbegin()
noexcept;
401 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
402 select_reverse_iterator<L> rend()
noexcept;
404 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
405 select_const_reverse_iterator<L> rbegin()
const noexcept;
406 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
407 select_const_reverse_iterator<L> rend()
const noexcept;
408 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
409 select_const_reverse_iterator<L> crbegin()
const noexcept;
410 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL>
411 select_const_reverse_iterator<L> crend()
const noexcept;
413 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
414 broadcast_iterator<S, L> begin(
const S& shape)
noexcept;
415 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
416 broadcast_iterator<S, L> end(
const S& shape)
noexcept;
418 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
419 const_broadcast_iterator<S, L> begin(
const S& shape)
const noexcept;
420 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
421 const_broadcast_iterator<S, L> end(
const S& shape)
const noexcept;
422 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
423 const_broadcast_iterator<S, L> cbegin(
const S& shape)
const noexcept;
424 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
425 const_broadcast_iterator<S, L> cend(
const S& shape)
const noexcept;
427 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
428 reverse_broadcast_iterator<S, L> rbegin(
const S& shape)
noexcept;
429 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
430 reverse_broadcast_iterator<S, L> rend(
const S& shape)
noexcept;
432 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
433 const_reverse_broadcast_iterator<S, L> rbegin(
const S& shape)
const noexcept;
434 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
435 const_reverse_broadcast_iterator<S, L> rend(
const S& shape)
const noexcept;
436 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
437 const_reverse_broadcast_iterator<S, L> crbegin(
const S& shape)
const noexcept;
438 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL,
class S>
439 const_reverse_broadcast_iterator<S, L> crend(
const S& shape)
const noexcept;
443 derived_type& derived_cast();
444 const derived_type& derived_cast()
const;