Iros
Loading...
Searching...
No Matches
fill_n.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
di/container/algorithm/in_out_result.h
"
4
#include "
di/container/concepts/prelude.h
"
5
#include "
di/container/iterator/prelude.h
"
6
#include "
di/container/meta/prelude.h
"
7
8
namespace
di::container
{
9
namespace
detail
{
10
struct
FillNFunction
{
11
template
<
typename
T, concepts::OutputIterator<T const&> Out,
typename
SSizeType = meta::IteratorSSizeType<Out>>
12
constexpr
auto
operator()
(Out first,
meta::TypeIdentity<SSizeType>
n, T
const
& value)
const
-> Out {
13
for
(SSizeType i = 0; i < n; ++i, ++first) {
14
*first = value;
15
}
16
return
first;
17
}
18
};
19
}
20
21
constexpr
inline
auto
fill_n
=
detail::FillNFunction
{};
22
}
23
24
namespace
di
{
25
using
container::fill_n
;
26
}
in_out_result.h
prelude.h
prelude.h
prelude.h
di::container::detail
Definition
sequence.h:13
di::container
Definition
sequence.h:12
di::container::fill_n
constexpr auto fill_n
Definition
fill_n.h:21
di::meta::TypeIdentity
Type< TypeConstant< T > > TypeIdentity
This is a helper template to prevent C++ from deducing the type of template argument.
Definition
core.h:32
di
Definition
zstring_parser.h:9
di::container::detail::FillNFunction
Definition
fill_n.h:10
di::container::detail::FillNFunction::operator()
constexpr auto operator()(Out first, meta::TypeIdentity< SSizeType > n, T const &value) const -> Out
Definition
fill_n.h:12
libs
di
include
di
container
algorithm
fill_n.h
Generated by
1.13.0