Iros
Loading...
Searching...
No Matches
fill.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
FillFunction
{
11
template
<
typename
T, concepts::OutputIterator<T const&> Out, concepts::SentinelFor<Out> Sent>
12
constexpr
auto
operator()
(Out first, Sent last, T
const
& value)
const
-> Out {
13
for
(; first != last; ++first) {
14
*first = value;
15
}
16
return
first;
17
}
18
19
template
<
typename
T, concepts::OutputContainer<T const&> Out>
20
constexpr
auto
operator()
(Out&&
container
, T
const
& value)
const
->
meta::BorrowedIterator<Out>
{
21
return
(*
this
)(
container::begin
(
container
),
container::end
(
container
), value);
22
}
23
};
24
}
25
26
constexpr
inline
auto
fill
=
detail::FillFunction
{};
27
}
28
29
namespace
di
{
30
using
container::fill
;
31
}
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
constexpr auto fill
Definition
fill.h:26
di::container::end
constexpr auto end
Definition
end.h:47
di::container::begin
constexpr auto begin
Definition
begin.h:44
di::meta::BorrowedIterator
Conditional< concepts::BorrowedContainer< Con >, ContainerIterator< Con >, container::Dangling > BorrowedIterator
Definition
borrowed_iterator.h:11
di
Definition
zstring_parser.h:9
di::container::detail::FillFunction
Definition
fill.h:10
di::container::detail::FillFunction::operator()
constexpr auto operator()(Out first, Sent last, T const &value) const -> Out
Definition
fill.h:12
di::container::detail::FillFunction::operator()
constexpr auto operator()(Out &&container, T const &value) const -> meta::BorrowedIterator< Out >
Definition
fill.h:20
libs
di
include
di
container
algorithm
fill.h
Generated by
1.13.0