di 0.1.0
Loading...
Searching...
No Matches
adjacent_transform.h
Go to the documentation of this file.
1#pragma once
2
9
10namespace di::container::view {
11namespace detail {
12 template<size_t N>
13 struct AdjacentTransformFunction {
14 template<concepts::ViewableContainer Con, typename F>
15 constexpr auto operator()(Con&& container, F&& function) const -> concepts::View auto {
16 if constexpr (N == 0) {
17 return zip_transform(util::forward<F>(function));
18 } else {
19 return AdjacentTransformView<meta::AsView<Con>, meta::Decay<F>, N>(util::forward<Con>(container),
20 util::forward<F>(function));
21 }
22 }
23 };
24}
25
26template<size_t N>
27constexpr inline auto adjacent_transform = function::curry_back(detail::AdjacentTransformFunction<N> {}, meta::c_<2ZU>);
28}
29
30namespace di {
31using view::adjacent_transform;
32}
Definition adjacent.h:8
constexpr auto adjacent_transform
Definition adjacent_transform.h:27
constexpr auto zip_transform
Definition zip_transform.h:38
constexpr auto curry_back
Definition curry_back.h:141
Conditional< concepts::LanguageArray< RemoveReference< T > >, RemoveExtent< RemoveReference< T > > *, Conditional< concepts::LanguageFunction< RemoveReference< T > >, AddPointer< RemoveReference< T > >, RemoveCVRef< T > > > Decay
Definition language.h:574
constexpr auto c_
A value of type Constexpr<val>.
Definition constexpr.h:252
Definition any_storable.h:9