Iros
 
Loading...
Searching...
No Matches
stride.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace di::container::view {
7namespace detail {
8 struct StrideFunction;
9
10 template<typename Con, typename SSizeType>
12
13 template<typename Con, typename SSizeType>
14 concept ViewStride = requires(Con&& container, SSizeType&& stride) {
15 StrideView { util::forward<Con>(container), util::forward<SSizeType>(stride) };
16 };
17
19 template<concepts::ViewableContainer Con, typename SSizeType = meta::ContainerSSizeType<Con>>
21 constexpr auto operator()(Con&& container, meta::TypeIdentity<SSizeType> stride) const -> concepts::View auto {
22 if constexpr (CustomStride<Con, SSizeType>) {
23 return function::tag_invoke(*this, util::forward<Con>(container), util::forward<SSizeType>(stride));
24 } else {
25 return StrideView { util::forward<Con>(container), util::forward<SSizeType>(stride) };
26 }
27 }
28 };
29}
30
32}
33
34namespace di {
35using view::stride;
36}
Definition stride_view.h:22
Definition tag_invoke.h:33
Definition view.h:10
Definition adjacent.h:9
Definition adjacent.h:8
constexpr auto stride
Definition stride.h:31
Definition sequence.h:12
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22
constexpr auto curry_back
Definition curry_back.h:141
Type< TypeConstant< T > > TypeIdentity
This is a helper template to prevent C++ from deducing the type of template argument.
Definition core.h:32
constexpr auto c_
A value of type Constexpr<val>.
Definition constexpr.h:252
Definition zstring_parser.h:9