Iros
 
Loading...
Searching...
No Matches
repeat.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 {
11 template<typename T>
12 constexpr auto operator()(T&& value) const -> meta::TagInvokeResult<RepeatFunction, 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<RepeatFunction, 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::RepeatView(util::declval<T>()); })
23 constexpr auto operator()(T&& value) const {
24 return container::RepeatView(util::forward<T>(value));
25 }
26
27 template<typename T, typename Bound>
29 constexpr auto operator()(T&& value, Bound&& bound) const {
30 return container::RepeatView(util::forward<T>(value), util::forward<Bound>(bound));
31 }
32 };
33}
34
35constexpr inline auto repeat = detail::RepeatFunction {};
36}
37
38namespace di {
39using view::repeat;
40}
Definition adjacent.h:9
Definition adjacent.h:8
constexpr auto repeat
Definition repeat.h:35
RepeatView(T, Bound) -> RepeatView< 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) const -> meta::TagInvokeResult< RepeatFunction, T >
Definition repeat.h:12
constexpr auto operator()(T &&value, Bound &&bound) const -> meta::TagInvokeResult< RepeatFunction, T, Bound >
Definition repeat.h:17