Iros
 
Loading...
Searching...
No Matches
generate_n.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace di::container {
8namespace detail {
10 template<concepts::Iterator Out, typename SSizeType = meta::IteratorSSizeType<Out>,
11 concepts::CopyConstructible F>
13 constexpr auto operator()(Out output, meta::TypeIdentity<SSizeType> n, F gen) const -> Out {
14 for (SSizeType i = 0; i < n; ++i, ++output) {
15 *output = function::invoke(gen);
16 }
17 return output;
18 }
19 };
20}
21
22constexpr inline auto generate_n = detail::GenerateNFunction {};
23}
Definition indirectly_writable.h:8
Definition invoke.h:58
Definition sequence.h:13
Definition sequence.h:12
constexpr auto generate_n
Definition generate_n.h:22
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