Iros
 
Loading...
Searching...
No Matches
for_each_n.h
Go to the documentation of this file.
1#pragma once
2
9
10namespace di::container {
11namespace detail {
13 template<concepts::InputIterator Iter, typename SSizeType = meta::IteratorSSizeType<Iter>,
14 typename Proj = function::Identity, concepts::IndirectlyUnaryInvocable<meta::Projected<Iter, Proj>> F>
15 constexpr auto operator()(Iter first, meta::TypeIdentity<SSizeType> n, F f, Proj proj = {}) const
17 for (SSizeType i = 0; i < n; ++i, ++first) {
19 }
20 return { util::move(first), util::move(f) };
21 }
22 };
23}
24
25constexpr inline auto for_each_n = detail::ForEachNFunction {};
26}
27
28namespace di {
30}
Definition sequence.h:13
Definition sequence.h:12
constexpr auto for_each_n
Definition for_each_n.h:25
constexpr auto invoke
Definition invoke.h:100
Type< TypeConstant< T > > TypeIdentity
This is a helper template to prevent C++ from deducing the type of template argument.
Definition core.h:32
Definition zstring_parser.h:9
constexpr auto proj
Definition proj.h:59
Definition in_fun_result.h:8
Definition for_each_n.h:12
constexpr auto operator()(Iter first, meta::TypeIdentity< SSizeType > n, F f, Proj proj={}) const -> InFunResult< Iter, F >
Definition for_each_n.h:15