| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- #pragma once
- #include <cstddef>
- #include <iterator/concepts.h>
- #include <iterator/detail/projection_tuple.h>
- #include <iterator/detail/recursive_expander.h>
- #include <iterator/end_aware_iterator.h>
- #include <iterator/forwards.h>
- #include <iterator/recursive_iterator.h>
- namespace iterator {
- template <typename It, typename... Projs, typename MaxDepth>
- class ProjectingRecursiveIterator<It, detail::Projections<Projs...>, MaxDepth>
- : public RecursiveHelper<It, MaxDepth, detail::Projections<Projs...>>::type,
- public Facade<ProjectingRecursiveIterator<
- It, detail::Projections<Projs...>, MaxDepth>> {
- public:
- using sentinel_type = sentinel_t;
- public:
- ProjectingRecursiveIterator() = default;
- explicit ProjectingRecursiveIterator(Range auto & range, Projs... projs)
- : ProjectingRecursiveIterator(EndAwareIterator(range), projs...) {}
- explicit ProjectingRecursiveIterator(Range auto & range, MaxDepth,
- Projs... projs)
- : ProjectingRecursiveIterator(EndAwareIterator(range), projs...) {}
- explicit ProjectingRecursiveIterator(EndAwareIterator<It> iter, MaxDepth,
- Projs... projs)
- : ProjectingRecursiveIterator::RecursiveBase(iter, projs...) {}
- explicit ProjectingRecursiveIterator(EndAwareIterator<It> iter,
- Projs... projs)
- : ProjectingRecursiveIterator::RecursiveBase(iter, projs...) {}
- template <typename Ot>
- explicit ProjectingRecursiveIterator(EndAwareIterator<Ot> other,
- Projs... projs)
- : ProjectingRecursiveIterator(EndAwareIterator<It>(other), projs...) {}
- template <typename Ot>
- explicit ProjectingRecursiveIterator(EndAwareIterator<Ot> other, MaxDepth,
- Projs... projs)
- : ProjectingRecursiveIterator(EndAwareIterator<It>(other), projs...) {}
- };
- template <Range R, typename... Projs>
- ProjectingRecursiveIterator(R, Projs...)
- -> ProjectingRecursiveIterator<iterator_t<R>, detail::Projections<Projs...>,
- bounded<sizeof...(Projs) + 1>>;
- template <typename It, typename... Projs>
- ProjectingRecursiveIterator(EndAwareIterator<It>, Projs...)
- -> ProjectingRecursiveIterator<It, detail::Projections<Projs...>,
- bounded<sizeof...(Projs) + 1>>;
- template <Range R, typename... Projs, size_t N>
- requires(N > sizeof...(Projs))
- ProjectingRecursiveIterator(R, bounded<N>, Projs...)
- -> ProjectingRecursiveIterator<iterator_t<R>, detail::Projections<Projs...>,
- bounded<N>>;
- template <typename It, typename... Projs, size_t N>
- requires(N > sizeof...(Projs))
- ProjectingRecursiveIterator(EndAwareIterator<It>, bounded<N>, Projs...)
- -> ProjectingRecursiveIterator<It, detail::Projections<Projs...>,
- bounded<N>>;
- template <Range R, typename... Projs>
- ProjectingRecursiveIterator(R, unbounded, Projs...)
- -> ProjectingRecursiveIterator<iterator_t<R>, detail::Projections<Projs...>,
- unbounded>;
- template <typename It, typename... Projs>
- ProjectingRecursiveIterator(EndAwareIterator<It>, unbounded, Projs...)
- -> ProjectingRecursiveIterator<It, detail::Projections<Projs...>,
- unbounded>;
- }
|