di 0.1.0
Loading...
Searching...
No Matches
common.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 template<typename T>
13 concept AllCommon = concepts::CommonContainer<T>;
14
15 template<typename T>
16 concept ViewCommon = requires(T&& container) { CommonView { util::forward<T>(container) }; };
17
18 struct CommonFunction : public function::pipeline::EnablePipeline {
19 template<concepts::ViewableContainer Con>
20 requires(AllCommon<Con> || ViewCommon<Con>)
21 constexpr auto operator()(Con&& container) const -> concepts::View auto {
22 if constexpr (AllCommon<Con>) {
23 return all(util::forward<Con>(container));
24 } else {
25 return CommonView { util::forward<Con>(container) };
26 }
27 }
28 };
29}
30
31constexpr inline auto common = detail::CommonFunction {};
32}
33
34namespace di {
35using view::common;
36}
Definition adjacent.h:8
constexpr auto common
Definition common.h:31
constexpr auto all
Definition all.h:35
CommonView(Con &&) -> CommonView< meta::AsView< Con > >
Definition any_storable.h:9