Iros
 
Loading...
Searching...
No Matches
chunk_by.h
Go to the documentation of this file.
1#pragma once
2
6#include "di/util/forward.h"
7
8namespace di::container::view {
9namespace detail {
10 struct ChunkByFunction;
11
12 template<typename Con, typename Pred>
14
15 template<typename Con, typename Pred>
16 concept ViewChunkBy = requires(Con&& container, Pred&& predicate) {
17 ChunkByView { util::forward<Con>(container), util::forward<Pred>(predicate) };
18 };
19
21 template<concepts::ViewableContainer Con, typename Pred>
23 constexpr auto operator()(Con&& container, Pred&& predicate) const -> concepts::View auto {
24 if constexpr (CustomChunkBy<Con, Pred>) {
25 return function::tag_invoke(*this, util::forward<Con>(container), util::forward<Pred>(predicate));
26 } else {
27 return ChunkByView { util::forward<Con>(container), util::forward<Pred>(predicate) };
28 }
29 }
30 };
31}
32
34}
35
36namespace di {
37using view::chunk_by;
38}
Definition chunk_by_view.h:27
Definition tag_invoke.h:33
Definition view.h:10
Definition adjacent.h:9
Definition adjacent.h:8
constexpr auto chunk_by
Definition chunk_by.h:33
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
constexpr auto c_
A value of type Constexpr<val>.
Definition constexpr.h:252
Definition zstring_parser.h:9