12 template<
typename F,
typename P>
13 struct CanInvokeRepeatHelper : meta::Constexpr<false> {};
15 template<
typename F,
typename... Rs>
16 requires(concepts::Invocable<F, Rs...>)
17 struct CanInvokeRepeatHelper<F, meta::List<Rs...>> : Constexpr<true> {
21 template<
typename F,
typename V,
size_t N>
22 concept CanInvokeRepeat = CanInvokeRepeatHelper<F, meta::Repeat<V, N>>::value;
24 template<
typename F,
typename V,
size_t N>
25 using InvokeRepeatResult = CanInvokeRepeatHelper<F, meta::Repeat<V, N>>::Type;
28template<concepts::InputContainer View, concepts::MoveConstructible F,
size_t N>
29requires(concepts::View<View> && N > 0 && detail::CanInvokeRepeat<F&, meta::ContainerReference<View>, N> &&
30 concepts::CanReference<detail::InvokeRepeatResult<F&, meta::ContainerReference<View>, N>>)
35 template<
bool is_const>
38 template<
bool is_const>
41 template<
bool is_const>
44 template<
bool is_const>
47 template<
bool is_const>
49 :
public SentinelExtension<Sentinel<is_const>, InnerSentinel<is_const>, Iterator<is_const>,
50 InnerIterator<is_const>> {
57 constexpr explicit Sentinel(InnerSentinel<is_const> sentinel) : Base(sentinel) {}
60 constexpr Sentinel() =
default;
62 constexpr Sentinel(Sentinel<!is_const> other)
64 : Base(other.
base()) {}
67 template<
bool is_const>
70 Iterator<is_const>, InnerIterator<is_const>,
71 meta::RemoveCVRef<detail::InvokeRepeatResult<
72 meta::MaybeConst<is_const, F>&, meta::ContainerReference<meta::MaybeConst<is_const, View>>, N>>> {
74 Iterator<is_const>, InnerIterator<is_const>,
81 InnerIterator<is_const> iterator)
82 : Base(util::move(iterator)), m_parent(util::addressof(parent)) {}
89 constexpr Iterator(Iterator<!is_const> other)
91 : Base(util::move(other).base()), m_parent(other.m_parent) {}
93 constexpr auto operator*()
const ->
decltype(
auto) {
95 [&](
auto const&... iters) ->
decltype(
auto) {
98 this->base().iterators());
103 friend class Iterator;
107 return util::move(*self);
122 constexpr auto begin() {
return Iterator<false>(*
this, m_inner.begin()); }
125 requires(
concepts::Container<InnerView const> &&
126 detail::CanInvokeRepeat<F const&,
meta::ContainerReference<
View const>, N>)
128 return Iterator<true>(*
this, m_inner.begin());
133 return Iterator<false>(*
this, m_inner.end());
135 return Sentinel<false>(m_inner.end());
139 constexpr auto end() const
140 requires(
concepts::Container<InnerView const> &&
141 detail::CanInvokeRepeat<F const&,
meta::ContainerReference<
View const>, N>)
144 return Iterator<true>(*
this, m_inner.end());
146 return Sentinel<true>(m_inner.end());
153 return m_inner.size();
157 requires(
concepts::SizedContainer<InnerView const>)
159 return m_inner.size();
Definition adjacent_view.h:20
Definition iterator_extension.h:19
Definition sentinel_extension.h:10
constexpr auto base() const -> Sent
Definition sentinel_extension.h:16
Definition view_interface.h:26
Definition rebindable_box.h:42
Definition common_container.h:10
Definition operations.h:99
Definition operations.h:27
Definition sized_container.h:8
Definition any_storable.h:9
constexpr auto move
Definition move.h:38
auto tag_invoke(types::Tag< util::deduce_create >, InPlaceTemplate< NodeHashMap >, Con &&) -> NodeHashMap< meta::TupleElement< T, 0 >, meta::TupleElement< T, 1 > >
constexpr auto invoke
Definition invoke.h:100
di::meta::Decay< decltype(T)> Tag
Definition tag_invoke.h:28
constexpr auto apply(F &&f, Tup &&tuple) -> decltype(detail::apply_impl(meta::MakeIndexSequence< meta::TupleSize< Tup > > {}, util::forward< F >(f), util::forward< Tup >(tuple)))
Definition apply.h:22