Iros
 
Loading...
Searching...
No Matches
join_with.h
Go to the documentation of this file.
1#pragma once
2
8#include "di/util/forward.h"
9
10namespace di::container::view {
11namespace detail {
12 struct JoinWithFunction;
13
14 template<typename Con, typename Pattern>
16
17 template<typename Con, typename Pattern>
18 concept ViewJoinWith = requires(Con&& container, Pattern&& pattern) {
19 JoinWithView { util::forward<Con>(container), util::forward<Pattern>(pattern) };
20 };
21
23 template<concepts::ViewableContainer Con, typename Pattern>
25 constexpr auto operator()(Con&& container, Pattern&& pattern) const {
26 if constexpr (CustomJoinWith<Con, Pattern>) {
27 return function::tag_invoke(*this, util::forward<Con>(container), util::forward<Pattern>(pattern));
28 } else {
29 return JoinWithView { util::forward<Con>(container), util::forward<Pattern>(pattern) };
30 }
31 }
32 };
33}
34
36}
37
38namespace di {
39using view::join_with;
40}
Definition join_with_view.h:30
Definition tag_invoke.h:33
Definition adjacent.h:9
Definition adjacent.h:8
constexpr auto join_with
Definition join_with.h:35
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