Iros
 
Loading...
Searching...
No Matches
take_while.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 TakeWhileFunction;
11
12 template<typename Con, typename Pred>
14
15 template<typename Con, typename Pred>
16 concept ViewTakeWhile = requires(Con&& container, Pred&& predicate) {
17 TakeWhileView { 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 (CustomTakeWhile<Con, Pred>) {
25 return function::tag_invoke(*this, util::forward<Con>(container), util::forward<Pred>(predicate));
26 } else {
27 return TakeWhileView { util::forward<Con>(container), util::forward<Pred>(predicate) };
28 }
29 }
30 };
31}
32
34}
35
36namespace di {
37using view::take_while;
38}
Definition take_while_view.h:16
Definition tag_invoke.h:33
Definition view.h:10
Definition adjacent.h:9
Definition adjacent.h:8
constexpr auto take_while
Definition take_while.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