Iros
 
Loading...
Searching...
No Matches
iota.h
Go to the documentation of this file.
1#pragma once
2
5#include "di/util/declval.h"
6#include "di/util/forward.h"
7
8namespace di::container::view {
9namespace detail {
10 struct IotaFunction {
11 template<typename T>
12 constexpr auto operator()(T&& value) const -> meta::TagInvokeResult<IotaFunction, T> {
13 return function::tag_invoke(*this, util::forward<T>(value));
14 }
15
16 template<typename T, typename Bound>
17 constexpr auto operator()(T&& value, Bound&& bound) const -> meta::TagInvokeResult<IotaFunction, T, Bound> {
18 return function::tag_invoke(*this, util::forward<T>(value), util::forward<Bound>(bound));
19 }
20
21 template<typename T>
22 requires(requires { container::IotaView(util::declval<T>()); })
23 constexpr auto operator()(T&& value) const {
24 return container::IotaView(util::forward<T>(value));
25 }
26
27 template<typename T, typename Bound>
29 constexpr auto operator()(T&& value, Bound&& bound) const {
30 return container::IotaView(util::forward<T>(value), util::forward<Bound>(bound));
31 }
32 };
33}
34
35constexpr inline auto iota = detail::IotaFunction {};
36}
37
38namespace di {
39using view::iota;
40}
Definition adjacent.h:9
Definition adjacent.h:8
constexpr auto iota
Definition iota.h:35
IotaView(T, Bound) -> IotaView< T, Bound >
constexpr tag_invoke_detail::TagInvokeFn tag_invoke
Definition tag_invoke.h:22
decltype(di::function::tag_invoke(util::declval< Tag >(), util::declval< Args >()...)) TagInvokeResult
Definition tag_invoke.h:40
auto declval() -> meta::AddRValueReference< T >
Definition declval.h:8
Definition zstring_parser.h:9
constexpr auto operator()(T &&value, Bound &&bound) const -> meta::TagInvokeResult< IotaFunction, T, Bound >
Definition iota.h:17
constexpr auto operator()(T &&value) const -> meta::TagInvokeResult< IotaFunction, T >
Definition iota.h:12