Iros
 
Loading...
Searching...
No Matches
all.h
Go to the documentation of this file.
1#pragma once
2
8#include "di/meta/util.h"
9#include "di/util/declval.h"
10#include "di/util/forward.h"
11
12namespace di::container::view {
13namespace 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
21 template<concepts::ViewableContainer 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
35constexpr inline auto all = detail::AllFunction {};
36}
Definition owning_view.h:21
Definition ref_view.h:21
Definition view.h:10
Definition adjacent.h:9
Definition adjacent.h:8
constexpr auto all
Definition all.h:35
Definition sequence.h:12