Iros
Loading...
Searching...
No Matches
all.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
di/container/concepts/view.h
"
4
#include "
di/container/concepts/viewable_container.h
"
5
#include "
di/container/view/owning_view.h
"
6
#include "
di/container/view/ref_view.h
"
7
#include "
di/function/pipeline.h
"
8
#include "
di/meta/util.h
"
9
#include "
di/util/declval.h
"
10
#include "
di/util/forward.h
"
11
12
namespace
di::container::view
{
13
namespace
detail
{
14
template
<
typename
Con>
15
concept
AllRefView
=
requires
(Con&&
container
) {
RefView
{ util::forward<Con>(
container
) }; };
16
17
template
<
typename
Con>
18
concept
AllOwningView
=
requires
(Con&&
container
) {
OwningView
{ util::forward<Con>(
container
) }; };
19
20
struct
AllFunction
:
function::pipeline::EnablePipeline
{
21
template
<concepts::ViewableContainer Con>
22
requires
(
concepts::View<meta::Decay<Con>
> ||
AllRefView<Con>
||
AllOwningView<Con>
)
23
constexpr
auto
operator
()(Con&&
container
)
const
{
24
if
constexpr
(
concepts::View<meta::Decay<Con>
>) {
25
return
util::forward<Con>(
container
);
26
}
else
if
constexpr
(
AllRefView<Con>
) {
27
return
RefView
{ util::forward<Con>(
container
) };
28
}
else
{
29
return
OwningView
{ util::forward<Con>(
container
) };
30
}
31
}
32
};
33
}
34
35
constexpr
inline
auto
all
=
detail::AllFunction
{};
36
}
di::container::OwningView
Definition
owning_view.h:21
di::container::RefView
Definition
ref_view.h:21
di::concepts::View
Definition
view.h:10
di::container::view::detail::AllOwningView
Definition
all.h:18
di::container::view::detail::AllRefView
Definition
all.h:15
view.h
declval.h
forward.h
di::container::view::detail
Definition
adjacent.h:9
di::container::view
Definition
adjacent.h:8
di::container::view::all
constexpr auto all
Definition
all.h:35
di::container
Definition
sequence.h:12
owning_view.h
pipeline.h
ref_view.h
di::container::view::detail::AllFunction
Definition
all.h:20
di::function::pipeline::EnablePipeline
Definition
pipeable.h:8
util.h
viewable_container.h
libs
di
include
di
container
view
all.h
Generated by
1.13.0